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);
action.keyDown(Keys.CONTROL).sendKeys(Keys.F5).keyUp(Keys.CONTROL).perform();

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

Snippet:

<div class=”states”>
<p>Cities</P>
9
</div>

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.


Top 25 selenium interview question.

 

 


Tags: selenium interview questions, top selenium interview questions