Selenium Interview Questions

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 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 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 Interview:

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


General selenium 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 and Java Interview Questions:

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 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 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



Links: Top 25 selenium interview questions.



Tags: selenium interview questions, top selenium interview questions, Selenium and java interview questions for testers and automation test engineers

Leave a Reply

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