Selenium Interview Questions and Answers
1.What is Selenium?
Selenium is one of the most popular automated testing tool used to automate various types of applications. Selenium is a package of several testing tools designed in a way for to support and encourage automation testing of functional aspects of web-based applications and a wide range of browsers and platforms and for the same reason, it is referred to as a Suite. Due to its existence in the open source community, it has become one of the most accepted tools amongst the testing professionals. It consists of three main parts: Selenium IDE, Selenium RC & Selenium Web Driver. Each of these tools is designed to cater different testing and test environment requirements.
2.Where we use Selenium and why we use Selenium?
Selenium is used in Automation Testing. Selenium is highly flexible Tool and is used to allowing more options for locating UI elements and comparing expected test results against actual application behavior and also is used to support for executing one’s tests on multiple browser platforms.
3.Why Selenium is good tool for Automation Testing?
- It is Free and 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.
4.What are the Selenium tools Components?
The Selenium tool package components are:
- Selenium RC
- Selenium IDE (Integrated Development Environment)
- Selenium Web driver
- Selenium Grid
5.What is meant by Selenium IDE?
Selenium IDE (Integrated Development Environment) is a plug-in used to record and replay tests in Firefox browser. Scripts may be automatically recorded and edited manually providing auto-completion support and the ability to move commands around quickly.
6.When we will use Selenium IDE?
Selenium IDE is the simple and easy tool of all the Selenium Package Tools. It has record and playback feature make it exceptionally easy to learn with minimal acquaintances to any programming language. Selenium IDE is an ideal tool for a naïve user.
7.What are the testing types that can be supported by Selenium?
Selenium supports the following types of testing’s:
- Functional Testing
- Regression Testing
8.What are the Disadvantages of Selenium?
Selenium supports testing of only web-based applications
Mobile applications cannot be tested using Selenium
Captcha and Barcode readers cannot be tested using Selenium
Reports can only be generated using third-party tools like TestNG or JUnit.
As Selenium is a free tool, thus there is no ready vendor support through the user can find numerous helping communities?
The user is expected to possess prior programming language knowledge.
9.How many types of selenium web driver APIs are available?
The list of driver classes could be used for the browser automation.
- Android Driver,
- Chrome Driver,
- Event Firing Web Driver,
- Firefox Driver,
- Html Unit Driver,
- I Phone Driver,
- I Phone Simulator Driver,
- Remote Web Driver
- Internet Explorer Driver
10.What are the different types of locators in Selenium?
The locator can be termed as an address that identifies a web element uniquely within the webpage. Thus, to identify web elements accurately and precisely we have different types of locators in Selenium:
- Link Text
- Partial Link Text
- X path
- Class Name
- Tag Name
- CSS Selector
11.What is meant by Selenese?
Selenese is the language which is used to write test scripts in Selenium IDE.
12.What are the Technical Challenges in Selenium?
- Selenium supports only web based applications
- It does not support the Bitmap comparison
- For any reporting related capabilities have to depend on third party tools
- No vendor support for tool compared to commercial tools like HP UFT
- As there is no object repository concept in Selenium, maintainability of objects becomes difficult
13.What is meant by X Path in selenium?
X Path is used to locate a web element based on its XML path. XML stands for Extensible Markup Language and is used to store, organize and transport arbitrary data. It stores data in a key-value pair which is very much similar to HTML tags. The fundamental behind locating elements using X Path is the traversing between various elements across the entire page and thus enabling a user to find an element with the reference of another element. Both being markup languages and since they fall under the same umbrella, X Path can be used to locate HTML elements.
14.What is the difference between the “/” and “//” in X path?
Single Slash “/” – The Single slash is used to create Xpath with absolute path i.e. the xpath would be created to start selection from the document node/start node.
Double Slash “//” – The Double slash is used to create Xpath with relative path i.e. the xpath would be created to start selection from anywhere within the document.
15.When should we use Selenium Grid?
Selenium Grid can be used to execute same or different test scripts on multiple platforms and browsers concurrently so as to achieve distributed test execution, testing under different environments and saving execution time remarkably.
16.What do we mean by Selenium 1 and Selenium 2?
Selenium RC and Web Driver, in a combination, are popularly known as Selenium 2. Selenium RC alone is also referred as Selenium
17.Which is the latest Selenium tool?
18.How do I launch the browser using Web Driver?
The following syntax can be used to launch Browser:
WebDriver driver = new FirefoxDriver();
WebDriver driver = new ChromeDriver();
Web Driver driver = new Internet Explorer Driver();
19.What are the different types of Drivers available in Web Driver?
The different drivers available in WebDriver are:
- Fire fox Driver
- Internet Explorer Driver
- Chrome Driver
- Safari Driver
- Opera Driver
- Android Driver
- IPhone Driver
- Html Unit Driver
20. What are the different types of waits available in Web Driver?
There are two types of waits available in Web Driver:
- Implicit Wait
- Explicit Wait
Implicit Wait: Implicit waits are used to provide a default waiting time (say 30 seconds) between each consecutive test step/command across the entire test script. Thus, subsequent test step would only execute when the 30 seconds have elapsed after executing the previous test step/command.
Explicit Wait: Explicit waits are used to halt the execution till the time a particular condition is met or the maximum time has elapsed. Unlike Implicit waits, explicit waits are applied for a particular instance only.
January 29, 2019
May 26, 2018
May 26, 2018