The Talent500 Blog

15 Basic Interview Questions Every Selenium Automation Tester Must Know

Given the world’s reliance on web-based applications, there is an equal need for software quality assurance. QA can be done manually, but if one is to save time, money and errors, it’s better to take the path of automation. This is the niche that Selenium dominates because it’s free, open source, and easy to use. With the ongoing need for QA, the job market is often rife with the demand for professionals with Selenium testing skill sets. Senior Selenium testers in India earn an average pay of Rs.8.93 lakh as per PayScale and so, climbing up the rungs in this domain is well worth the effort. In fact, an early career test automation engineer earns above Rs.6 lakh per annum on average, with tips, bonuses and overtime pay added.

To enjoy a hefty compensation, however, it is crucial to start off your career at a reputed organisation. This demands that you stand head and shoulders above the competition by nailing the basic Selenium interview questions that are normally asked. To be prepared and put your best foot forward, go through these 15 interview prep questions for a Selenium automation tester with 1 to 3 years of experience.

1. Selenium is open source and free. Suggest 5 more reasons to use it and comment upon its demerits.

The pros of Selenium include:

The demerits of Selenium include:

2. What does the Selenium suite comprise?

The Selenium tool suite consists of:

3. What is Selenium 2.0, Selenium 3.0, and Selenium 4.0?

Selenium 2.0 is a single tool comprising of RC (Selenium 1) and WebDriver. Selenium 3.0 is an improvement on Selenium 2.0, with bug fixes. Selenium 4.0 is being developed with a focus on W3C standardisation. It is currently in an alpha release.

4. What is XPath and Dynamic XPath in Selenium?

XPath is an XML path and is used by testers to navigate through the XML structure of a document to find an element based on its XML path expression. XPath may be used on XML and HTML documents. There are 2 types of XPath: absolute and relative.

Dynamic XPath or custom XPath is a way to find an element uniquely and, here, the expressions Contains, Ancestor and Sibling can be used.

5. List out ways in which you can find an element in Selenium

WebDriver supports the following locators:

6. What is meant by POM and what are its advantages?

POM stands for Page Object Model and is a design pattern used in Selenium to build an Object Repository for web UI elements. Here, each webpage has a corresponding Page Class and the different page elements are defined to be variables on the class.

POM optimises code, makes it maintainable, readable, reusable, and easier to grasp. Moreover, the test cases and Object Repository are independent, allowing for different integrations and testing.

7. Explain what Page Factory is in reference to POM.

Page Factory is a class in Selenium that allows testers to implement POM in an optimised way, wherein the @FindBy annotation is used to declare web elements and locate them. The idea of separating Test Methods and Page Object Repository is followed. @FindBy can have tagName, xpath, partialLinkText, name, linkText, className, id, and css for attributes. initElements() is used to initialise web elements that @FindBy locates.

8. Can you distinguish between single slash and double slash in relation to XPath?

An absolute XPath is created with a single slash “/” and a relative XPath is created with a double slash “//”. Testers use a single slash to start selection from the root node and cover the entire path till the element. Testers use a double slash to start selection from any point in the document, find a unique parent node and locate the element from there.

9. Name 4 exceptions in Selenium WebDriver.

10. How can Selenium handle alerts?

Selenium has 3 types of alerts: simple, prompt and confirmation. Alert handling can be done with:

Selenium has 3 types of alerts: simple, prompt and confirmation. Alert handling can be done with:

11. How can Selenium handle multiple windows?

Selenium can handle multiple windows with the following methods:

12. Distinguish between assert and verify commands

Both commands are used for validating an application. However, in case of:

13. Distinguish between driver.close() and driver.quit() commands

Testers use:

14. When would you use ID, XPath, Name and CSS Selector locators?

15. How would you perform database testing using Selenium?

Though Selenium WebDriver is limited to browser-based testing of applications, some amount of database testing can be carried out with the help of JDBC and ODBC.

These 15 questions cover the basic elements of Selenium, while also probing some tricky concepts. They will surely serve as a primer to more advanced questions and help you answer interview questions just like an industry expert would.

If you are on the lookout for a great Selenium automation tester job, sign up with Talent500. Our dynamic skill assessments and machine learning algorithms redefine job search for India’s best software engineers, seamlessly matching skill sets to the needs of Fortune 500 companies looking for the top 10% of talent. This way you’ll assure yourself of a promising career path – one that’s tried and tested!

0