Top 10 selenium testing job interview questions
- What is Selenium, and what is it comprised of?
Selenium is a group of tools used for automated web testing. It consists of:
Selenium IDE (Integrated Development Environment): This is a tool for recording and playback.
WebDriver and RC: Provides APIs for various languages such as Java, .NET, and PHP. Webdriver and RC work with most browsers.
Grids: Grids allow you to distribute your tests across multiple machines and run them in parallel.
- How to use selenium in finding an element?
In selenium, each object or control on a web page is called an element. There are several ways to find an item on a web page like surname, sign attribute, CSS, Link text, Partially link text, Xpath, etc.
- What are the test types that are supported by selenium?
Selenium can be used for web-based application testing. The supported test types are:
- a) See details of features and functional tests.
- b) Regression
For post-release validation using continuous integration automation tools, a) Jenkins
- b) Hudson
- c) Quick assembly
- d) CruiseCont
- Explain what is an assertion in selenium and what are the types of assertion?
The assertion is used as a validation point. Make sure that the status of your application is as expected. The assertion types are “assert”, “verify”, and “waitFor”.
- What is the use of X-path?
XPath is used to search for WebElements on web pages. Also, it helps in identifying dynamic elements.
- What is the difference between single and double slash in X-path?
Single slash `/.’
A single slash (/) initiates a selection from the document node. This allows you to create an “absolute” path expression.
Double slash (//) starts selection anywhere in the document. This allows you to create “relative” pass expressions.
- What are the technical challenges with selenium?
The technical challenges of the selenium include:
- It only supports web-based applications. Bitmap comparison is not supported.
- All report-related features require the use of third-party tools.
- No vendor support for tools compared to commercial tools like HP UFT.
- Selenium doesn’t have the concept of object repositories, which makes objects maintainable.
- What is the difference between a type key and a type command?
- What is the difference between verify and assert commands?
Assert: Assert allows you to check if an element is present on the page. If the confirmed item is not available, the test will stop at the failing step. That is, the test will stop when it fails.
Verify: It is the verification command that checks if the element is on the page, and if not, continues testing. Once verified, it guarantees that all commands will be executed even if one of the tests fails.
- What are JUnit Annotations, and what are the different types of annotations which are useful?
JAVA allows you to add special forms of syntax metadata, so-called annotations, to your Java source code. Variables, parameters, packages, methods, and classes are annotated. Here are some of the Java unit’s useful annotations: