---Advertisement---

Selenium Interview Questions and Answers (Part-v)

By Manisha

Updated On:

---Advertisement---

Q.126. How do you handle HTTP Proxy Authentication pop-ups in the browser?
Ans. You can handle HTTP Proxy Authentication pop-ups by embedding the username and password in the URL:

java

http://username:password@website.com

Q.127. How do you handle Ajax dropdowns?
Ans. You can use synchronization commands like WebDriverWait, FluentWait, or ImplicitWait to handle Ajax dropdowns in Selenium.

Q.128. What is the default port for Selenium Grid?
Ans. The default port for Selenium Grid is 4444.

Q.129. How to run tests in multiple browsers in parallel?
Ans. You can use Selenium Grid to run tests in parallel across different browsers.

Q.130. How to find broken images on a page using Selenium WebDriver?
Ans. You can use the following approach to find broken images:

java

List<WebElement> images = driver.findElements(By.tagName(“img”));

for (WebElement image : images) {

    String url = image.getAttribute(“src”);

    HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();

    connection.setRequestMethod(“GET”);

    connection.connect();

    if (connection.getResponseCode() >= 400) {

        System.out.println(url + ” is a broken link.”);

    }

}

131. How to disable cookies in the browser?

Ans:
Cookies can be deleted using:

java

driver.manage().deleteAllCookies();


Q.132. How do you handle dynamic elements without using XPath?

Ans:
You can use other locators like By.className, By.id, or By.cssSelector depending on the element attributes.


Q.133. Scenarios that cannot be automated with Selenium?

Ans:

  • CAPTCHA
  • Barcode scanning
  • Bitmap comparisons
  • Native OS dialogs (file upload/download)
  • Third-party calendar widgets
  • Image and Word/PDF content validation

Q.134. How do you manage code versions in your project?

Ans:
Using version control tools like Git, GitHub, Bitbucket, or SVN.


Q.135. How to count total number of hyperlinks on a webpage?

Ans:

java

List<WebElement> links = driver.findElements(By.tagName(“a”));

System.out.println(links.size());


Q.136. What are the benefits of Automation Testing?

Ans:

  • Faster execution
  • Reusable scripts
  • Less human error
  • Parallel and cross-browser execution
  • Easy maintenance and reporting
  • Increased test coverage
  • Best suited for regression testing

Q.137. What types of tests have you automated?

Ans:
Regression, Smoke, Sanity, and End-to-End test cases based on project scope and time.


Q.138. How many test cases have you automated per day?

Ans:

  • 2–5 per day for simple cases
  • 1 or fewer for complex scenarios

Q.139. What is Selenium IDE?

Ans:
A Firefox/Chrome plugin used to record and playback scripts. Good for beginners.


Q.140. What is Selenese?

Ans:
Selenese is the command set used in Selenium IDE to perform operations.


Q.141. What is Selenium RC?

Ans:
Selenium RC (Remote Control) is Selenium 1. It used a server to inject JavaScript into browsers. Deprecated in favor of WebDriver.


Q.142. What is Selenium WebDriver?

Ans:
A tool that directly interacts with browser internals to automate user actions. Supports multiple programming languages.


Q.143. When do you use Selenium Grid?

Ans:
When parallel test execution is needed across multiple browsers and platforms.


Q.144. Advantages of Selenium Grid?

Ans:

  • Parallel test execution
  • Cross-browser support
  • Saves execution time

Q.145. What is a Hub in Selenium Grid?

Ans:
A central server that controls test execution on multiple machines (nodes).

---Advertisement---

Leave a Comment