Articles

Top 30 Selenium Interview Questions

by Syntax Technologies Software Testing Training

While there are a number of Test Automation Tools available in the market, Selenium has emerged as one of the foremost Testing Tool of choice. Consequently, Selenium related jobs have emerged as coveted spots within the tech industry and by emphasizing upon some of the most significant Selenium Interview Questions, this guide will help you ace a Selenium Interview like a pro.

This blog has been carefully curated as a helpful guide covering some of the most important Selenium Interview Questions which appear in interviews across companies. This list of Selenium Interview Question and Answers is by no means complete, but it does focus on some of the most important areas that you should pay attention to as you prepare for your interview.

For the purpose of convenience, this blog has been divided into four parts and covers the top 30 Selenium Interview Questions and Answers.

Interview Questions on Selenium: BASIC Level

Selenium Interview Questions: INTERMEDIATE Level

Selenium Interview Questions for Experienced: ADVANCED Level

Selenium Webdriver Interview Questions

Conclusion

Interview Questions on Selenium: BASIC Level

  •  1. What are the different Selenium Suite Components?

The Selenium Automation software is not a single tool, but a suite of software, each of which serves a specific set of testing purpose for the organization. The tools are:

  • Ø  Selenium Integrated Development Environment (Selenium IDE)

It works as a Firefox plug-in which can be used to record and execute test cases. It was primarily created to accelerate the production of automation scripts

  • Ø  Selenium Remote Control (Selenium RC)

It was the first flagship testing tool which allowed users to write test cases in the preferred language of the user. It provides for cross-browser testing as well as data-driven testing.

  • Ø  Selenium WebDriver

It was created by Simon Stewart in 2006, as a solution to the shortcomings of Selenium RC. It provides an interface for creation as well as execution of test cases and it is possible to identify web page elements through the test cases and take appropriate action.

  • Ø  Selenium Grid

It makes use of the Hub-Node design which helps in simultaneous execution of more than one test case on different machines which happen to be remotely located. There is one master system which is the hub and it controls the other child systems which are the nodes. 

1.      2. Why should you use Selenium? What are its advantages?

·         Open-source and free

·         Supports test scripts in different programming languages

·         Provides for execution of test cases on multiple browsers and more than one operating systems

·         Facilitates parallel testing and has a huge community support

·         Provides for integration with JUnit and TestNG

·         Allows for Continuous Testing through integration of Selenium with Maven, Jenkins and Docker


1.      3. What is the difference between Selenium 2.0 and Selenium 3.0?

Selenium 2.0 provided for the merger of the Selenium Webdriver project with the original Selenium Project. Ever since so, Selenium RC got disapproved of, but was still used for backward compatibility.

Selenium 3.0 is held to be the extended version of Selenium 2.0. It is backward compatible, does not include Selenium RC and is inherently stable with several bug fixes. 

1.      4. What is Selenese? What are its types?

Selenese refers to Selenium commands which act as instructions for executing the test cases. A test script can be seen as a sequential collection of these Selenese commands.

There are three types of Selenese:

Ø  Actions: These commands are used for conducting operations on and interacting directly with the target elements.

Ø  Accessors: This command helps in storing values in a variable.

Ø  Assertions: These commands act as checkpoints for keeping track of the sequential execution of commands.

2.      5. What is the Same-Origin Policy? How was it resolved?

The Same-Origin Policy prohibited access to web elements from a domain which was different from the one where the JavaScript was launched. A web browser allowed scripts from a particular webpage to access content of another webpage provided both the pages came from the same domain.

The problem posed by the same-origin policy was sought to be rectified through the introduction of Selenium RC. It did seek to resolve the issue by including a HTTP proxy server which could deceive the browser into believing that the web application and the test script came from the same source.

3.      6. What are the different test types supported by Selenium?

The different test types supported by Selenium are:

Ø  Functional Testing

This kind of testing is conducted in order to determine whether an application functions as per the requirements of the project. Generally, it involves black box testing and does not concern itself with the source of the code. 

Ø  Regression Testing

It involves selection (full or partial) of already executed test cases in order to get them re-executed for evaluating the performance of existing functionalities.

1.      7. What is the difference between Verify and Assert Commands?

Ø  Verify

This command is used to check whether an element is on a page. It is used to specify whether a condition is true or false. If the element is not there, the test will keep on executing. Even if any of test fails, the rest of the commands will continue to run.

Ø  Assert

This command is used to check whether an element is on the page or not. If the asserted element is not present, then the test will stop and will not continue further.

2.     8. What is the difference between single slash and double slash in XPath in Selenium?

Ø  Single Slash (/)

·         It helps in starting the selection from the document or the start node

·         It allows the user to create Absolute expressions in XPath Selenium

Ø  Double Slash (//)

·         It helps in starting the selection from anywhere in the document

·         It allows the user to create Relative expressions in XPath Selenium 

1.     9. What is a locator? How will you locate an element in Selenium?

Locators in Selenium act as means for finding and matching elements on a webpage with which the user needs to interact with. Depending on the type of element which needs to be located, there are different types of locators present.

·         Name

·         ID

·         Partial Link

·         Class

·         XPath

·         Link Text

·         CSS Selector

2.     10. What are the technical limitations of Selenium?

·         It can only be used to test web applications and is not suitable for testing mobile or desktop software applications

·         It cannot acquire access to web elements detected to be outside the web application which is under test

·         There is no assured user support, apart from customer communities

·         It cannot be used for image testing or data-driven testing independently

·         It requires prior knowledge of programming language to write tests

·         Selenium cannot be used to test Captcha and barcode readers

3.     11. What is the Page Object Model (POM)? What are its advantages?

POM can be understood as a design pattern which helps in creating object repositories for the web UI elements. The web pages of applications have corresponding page classes which help in locating web elements and undertaking actions on them.

Advantages:

Ø  The same object repository can be used in multiple tests, as the repository itself is independent of test cases

Ø  It helps in providing for code readability, as it supports separate flows and operations on the UI from verification

Ø  It also enhances the reusability of the code

Selenium Interview Questions: INTERMEDIATE Level

4.     12. What are the different types of annotations used in Selenium?

Java facilitates the addition of a special form of syntactic metadata to the Java source code, which are known as annotations. It provides for the annotation of parameters, methods, variables, classes and packages. Some of these JUnit annotations are:

Ø  Test

Ø  Before

Ø  After

Ø  BeforeClass

Ø  AfterClass

Ø  Ignore

Ø  RunWith

5.     13. Can you automate Captcha?

Selenium cannot be used to automate Captcha. This is quite logical because the whole idea behind Captcha is to prevent automated program and bots from acquiring access to sensitive information. The Captcha needs to be manually typed by the tester or the test engineer in order to carry on the execution of the test suite. 

1.     14. What are the advantages of Selenium over QTP?

Ø  Selenium is distributed as an open-source, free Automation Tool; while QTP is commercialized and is distributed as a licensed, profitable tool

Ø  Selenium supports multiple programming languages; QTP supports only VBScript

Ø  Selenium supports multiple browsers as well as different operating systems; QTP supports only Firefox, Internet Explorer and Chrome, and the Windows operating system

Ø  While Selenium is specifically used for testing web-based applications; QTP can be used for testing client-server applications too

2.     15. What are Breakpoints and Start points in Selenium?

Ø  Breakpoints

These are used to stall the flow of execution of the test cases. When Breakpoint is implemented, the execution stops right there. This also helps in ascertaining that the code is working properly.

Ø  Start points

This refers to the point from where the execution of test suite should begin. This is invoked when the tester wants to execute the test script from the middle of a code or after a breakpoint.

3.     16. What is the difference between setSpeed() and sleep() methods?

Both these methods are used to delay the speed of execution.

Ø  setSpeed()

This command is used to stop the execution of every Selenium command for a specific amount of time. Each command after the setSpeed delay is executed with a delay of milliseconds as mentioned in setSpeed.

Ø  Thread.sleep()

This command suspends the execution of the current thread for a specified amount of time. It can be invoked only once. It takes a single argument in integer format.


Sponsor Ads


About Syntax Technologies Advanced   Software Testing Training

62 connections, 1 recommendations, 184 honor points.
Joined APSense since, January 11th, 2022, From Chantilly, United States.

Created on Feb 9th 2022 01:04. Viewed 374 times.

Comments

No comment, be the first to comment.
Please sign in before you comment.