Most Commonly Asked Top Selenium Interview Questions

By | August 4, 2020

Most Commonly Asked Top Selenium Interview Questions:

ADP Written test questions:

1. How to find inner text using CSS attribute. Options: css=tag:attribute (“inner text”); etc.

2. How to find words starting with ADP using CSS. Below are the few options.

  • tag:attribute(“starts-with@id, “ADP”);
  • tag:attribute(“@id, “ADP”); etc.

3. A question about Actions element.

4. Context click is used for ?

Options: i. Right click ii. Left click etc.

5. TestNG annotations.

6. Basic java questions.

ADP Selenium Interview questions:

  1. Which method do you follow while writing test cases? (Equivalence partitioning and Boundary value analysis).
  2. 1-100 Prime numbers program.
  3. Dynamic table. Write code to print all cell values.
  4. What is the syntax for Actions in selenium web driver?
  5. Excel reading (Selenium and Java).
  6. Have you used SQL in your framework? If yes, explain?
  7. File upload syntax. AutoIT.
  8. Why selenium and why not other tools?
  9. Selenium (copy data from one excel sheet to another).

Infor Selenium Interview Questions

  1. Explain relative and absolute xpaths. And which one is better?

Ans: Relative is better. Check in google for more.

  1. Table with columns name, designation, and salary. Arrange the table in ascending order.
Name Designation Salary
AAA D1 65000
BBB D2 50000
CCC D3 40000
DDD D4 75000

  1. TestNG annotations. Explain the sequence.
  2. Update table operation (SQL).
  3. How to find elements in Selenium.
  4. Windows-based popups handling. Is it possible in selenium?
  5. Why agile is better?
  6. What is object repository? Object repository is better or dynamically locating elements is better?

FACTSET Telephonic: Selenium Interview Questions:

1. Can you write try catch block in finally block?


General selenium interview questions:

Q. Element is clearly visible in the DOM but script is not able to identify it. What might be the reason?

A. Reason might be due to the element present in frames. For this scenario, first, we have to switch to the iFrame and then have to perform respective web action (like reading text or clciking on the link or button etc.,) on the element.

Q. How do you press Control and F5 key using selenium webdriver?

A.    Actions action = new Actions(driver);




Q: How to get only the number from below code snippet using xpath?


<div class=”states”>

Possible answers:

  1. //div[p[text()=’Cities’]]/text()
  2. //div[@class=’states’]/p[text()=’Cities’]/following-sibling::text()
  3. //div[.=‘9’]
  4. driver.findElement(By.cssSelector(“.states”).getText();
  5. driver.findElement(By.xpath(“//div[p[text()=’Cities’]]”)).getText().replaceAll(“\\D”, “”).trim();

You can try any of the above xpaths and verify the result.

ADP Selenium Interview Questions (And Java):

1 Write code to print prime numbers between 1 to 100.



2 Write locators used to locate web elements in selenium.

3 How will you perform double click operation in selenium.



4 Write xpath to click 2nd button without using index, starting from SPAN tag.




<button type=”submit”>



<button type=”submit”>


5 Click on the “Referral Bonus” link in the row having name “John”. It is a dynamic web table so rows may get interchanged.

S.No Name Salary Link
1 Robert 50,000 Referral Bonus
2 Sam 65,000 Referral Bonus
3 John 70,000 Referral Bonus
4 Amit 1,00,000 Referral Bonus

6 Students and Advisors table. Get all the information except having students who were not assigned to any advisor.

7 What are the exceptions faced in your project. Have you faced stale element exception, If yes, how did you handle it.

8 Tell me about string functions.

9 Write the logic for below output.

Actual string = “selenium99 automation testing”;

Expected String = “automation testing selenium99”;

10 Explain about agile process.

11 What is agile velocity.

12 Explain bug life cycle.

13 Explain me about your framework.

14 Have you worked on cucumber.

15. Do you know Hashmap.

16 What is the difference between List and Set.

17 How will you perform right click operation in selenium.

Sol: Right click operation is also called Context click in Selenium WebDriver.


HCL Telephonic round selenium interview questions (Selenium and Java):

1 Can you explain about this keyword?

2 Tell me about OOPS concepts.

3 Explain about Polymorphism.

4 Explain about your framework.

5 How much you can rate yourself in selenium?

6 Can you tell me the exceptions in selenium.

7 Can you explain POM framework.

8 Have you worked on continuous integration tools.

9 If sendKeys() is not working, how can you enter data in textbox?

10 How do you scroll in a web page in Selenium WebDriver?

Ans: Click here to learn how to perform scroll operations in Selenium WebDriver. 

ServiceNow Selenium interview questions (Selenium and Java):

1 Remove all numeric and special characters from the below string.


Expected: httpswwwworldcomaspcom


2 Insert an underscore ( _ ) whenever a lowercase and uppercase character is found.

Input: SeleniumTutorials

Output: Selenium_Tutorials


3. What is the output of below program?


Compile time error. Cannot make a static reference to the non-static field i.

4. Write 5 exceptions faced in selenium and explain when they occur.

5. Find the second largest number from an array.


Output: 2nd largest number is: 72

6. Predict the output.



7. What is the output of below code snippet?



Compilation error.

Cannot make a static reference to the non-static field i

8. m*n matrix. Numbers are in sorted and sequential order. Find whether number is present in this matrix or not.

9. Employee count in Department tabel.

10. Mid of the string

11. String palindrome

12. Advantages of OATS over Selenium? (This question will be asked only if you have OATS experience)

13. Gmail compose test scenarios.


Synechron Telephonic Round Selenium Interview Questions (Selenium):

1 Tell me about yourself.
2. Use of static keyword: static keyword in java is mainly used for memory management. Use the static variable for the property that is common to all objects. For example, in class Login, all methods  share the same username. Also use static methods for changing static variables.

Ex: static String username;

3. Explain encapsulation: It is a process of binding data members and methods together in a unit. Each class in java itself is an example of encapsulation.

Data Hiding:This is a process of keeping out internal data safe from unauthorized access. Means no one can access our internal data directly. To read more on encapsulation……click here

4. Use of abstract. why abstract. click here
5. What is Agile methodology.
6. Method overloading in selenium (like sendKeys).

Ans: Implicit wait is the best example for method overloading in selenium. Overloading happens when two methods in the same class have the same name but different parameters. We use different time stamps such as SECONDS, MINUTES, HOURS etc in Implicit wait.

7. Have you used collections in your project.

8. How do you handle window handles.
9. How to navigate to main/parent window handle.
10. String and string buffer.
11. final, finally and finalize.
12. Exceptions faced in selenium.
13. What is geckodriver.

14. What is the current java version?
15. What is the current selenium version?
16. What is selenium 3.0?


Links: Top 25 selenium interview questions.

Java interview questions:

How to check if string contains only digits in Java

How to check if string contains only alphabets in Java

Difference between flush and close in Java

How to capitalize the first letter of a String in Java

How to capitalize each word in Java

How to swap two numbers without using third variable in Java

Generate random between 1 to 10 in Java

Generate random between 1 to 5 in Java


Tags: selenium interview questions, top selenium interview questions, Selenium and java interview questions for testers and automation test engineers, selenium questions, top 100 selenium interview questions top 25 selenium interview questions selenium qa testing, selenium tutorials selenium testing python testing selenium java.

Other links: TestNG

arrays tostring in java | selenium interview questions

Leave a Reply

Your email address will not be published. Required fields are marked *