20 Frequently Asked Selenium Interview Questions and Answers
According to indeed.com, the number of interested job seekers with Selenium skills has been steadily rising over the past couple of years. There’s often a lucrative salary offered for these positions, ranging from $68,000/year for Quality Assurance Analyst jobs to $94,000/year for Automation Engineer jobs, and a fiercely competitive pool of candidates.
This is why the next logical step after securing an interview is thorough preparation. For any number of roles that use Selenium, employers will actively seek out candidates that can speak to its key benefits, features, and drawbacks. These 20 Selenium interview questions and answers will help refresh your Selenium knowledge to confidently tackle the interview.
1. What is automation testing?
Automation testing is the process of conducting tests using a software tool. The expected results of a test are fed into the tool to be compared with the actual output of the test.
2. Name some popular tools for automation testing.
- Rational Robot
- HP UFT
- IBM Rational Functional Tester
3. Define Selenium.
Selenium is a package of several testing tools designed for automated web testing.
4. Why is Selenium a choice tool for automation testing?
- It is open source
- It supports distributed testing
- It has regular repository developments
- It has a large user base and support community
- It has wide platform compatibility – Windows, Mac OS, and Linux, etc.
- It has cross-browser compatibility – Internet Explorer, Chrome, Firefox, Safari, etc.
- It supports multiple programming languages – Java, C#, Ruby, Perl, Python, etc.
5. What are the Selenium suite components?
The Selenium suite package consists of the following components:
- Selenium RC
- Selenium IDE (Integrated Development Environment)
- Selenium Webdriver
- Selenium Grid
6. Explain the difference between Selenium 1.0 and Selenium 2.0.
Selenium 1.0 consists of only Selenium RC.
Selenium RC and WebDriver are consolidated into a single tool to form Selenium 2.0.
7. What are the two types of waits available in WebDriver?
There are two types of waits in WebDriver:
- Implicit wait, which sets a timeout for all successive web element searches. It waits for an element to show up and looks for it repeatedly for a specified amount of time before messaging what’s called “NoSuchElementException.”
- Explicit wait, which is used one time for a particular search.
8. Where can you use Selenium Grid?
Selenium Grid allows you to run multiple instances of Selenium Remote Control in parallel concurrently and makes them appear as one. By leveraging your existing computing infrastructure, it allows you to run multiple functional tests in parallel, on multiple machines, against different browsers, in a heterogeneous environment.
9. What types of testing are supported by Selenium?
Selenium supports Regression testing and Functional testing.
10. What is assertion in Selenium?
Assertion is used as a verification point in Selenium. It verifies that the state of the application is as expected. The three types of assertion are:
11. Does Selenium have limitations? If so, what are some of these limitations?
Yes, Selenium has limitations. These include:
- Since it is free, there is no ready vendor support. However, it has a large helping community of developers
- It cannot be used to test mobile applications
- Its user is expected to possess knowledge of programming
- Selenium cannot be used to test Captcha and Bar code readers
- Test reports can only be generated using third party tools such as JUnit and TestNG
12. How can you use Selenium to identify an object?
You can use isElementPresent (String locator) to find an object using Selenium. It takes a locator as the argument and if found, returns a Boolean.
13. What is a locator? Name the different types of locators in Selenium.
A locator is an address that uniquely identifies a web element within a web page. Selenium has several different types of locators to identify web elements in web pages. These include:
- CSS Selector
14. What is XPath?
XPath is used to locate web elements based on their XML (Extensible Markup Language) paths. It can also be used to locate HTML elements.
15. What is the difference between single slash (/) and double slash (//) in Xpath?
Single slash (/) is used to create Xpath with absolute path. In this case, the Xpath starts selection from the document start node.
Double slash (//) is used to create Xpath with relative path. In this case, the Xpath starts selection from anywhere within the document.
16. What is an Object Repository? How is it created in Selenium?
An object repository allows a tester to store web elements of the Application Under Test (AUT) together with their locator values, in one or more centralized locations as opposed to hard coding them within the test scripts.
17. How can you handle windows based popups with Selenium?
Selenium solely supports web application testing. It does not support testing of Windows-based applications. To handle Windows-based pop-ups, third party intervention is required. AutoIT and Robot Class are examples of third party tools that you can use alongside selenium to handle Windows-based pop ups.
18. What is Selenese?
Selenese is a set of command in Selenium used for running a test.
19. Name the three types of Selenese.
- Accessors: Used for storing the values in a variable
- Actions: Used for performing the interactions and operations with the target elements
- Assertions: Used as a check point
20. What are Startpoints and Breakpoints in Selenium?
Startpoints indicate the point from where the execution should begin. They can be used to run a test script from a breakpoint or the middle of the code.
Breakpoints are used to stop execution of a code. They help you verify that your code is working as expected.
You interviewer will definitely cover multiple domains in his/her line of questioning. Therefore, no matter how good you are at writing code, you need to brush up your basic knowledge of Selenium. The interview questions and answers above should help you in your preparation.
You should also consider taking a Selenium Certification Training Course to improve your Selenium skills and employability.
Find our Selenium 3.0 Training Online Classroom training classes in top cities:
|Selenium 3.0 Training||4 May -26 May 2019, Weekend batch||Your City||View Details|
Recommended articles for you
Everything You Should Know About TestNG Annotations in Selen...Article
Why Engineers and Software Developers Should Get Certified i...Article
10 Most Popular DevOps Interview Questions and AnswersArticle