Selenium Interview Questions and Answers
Selenium is available as an open-source automated testing suite used for numerous web applications in diverse platforms and browsers. It found that Selenium is quite similar to HP Quick Test Pro (QTP and now also known as UFT). There is only one difference that it emphasizes automating web-based applications. If you think it is a single tool, then it is not. Selenium is present as a suite of software’s includes the testing requirement in an organization.
Here, we are discussing some of the critical questions asked at the time of the interview.
Q: 1 – What do you understand by Automation Testing?
Automation testing, also known as test automation, is known as a procedure used for automating manual processes required for testing the systems or applications under test. There are separate testing tools used in the complete procedure and meant for creating test scripts. Well, there is no requirement for manual intervention.
Q: 2 – What are the advantages of Automation testing?
If you also want to know about the noted benefits of Automation testing, they mentioned as –
Backup the execution of chronic test cases.
Assist in the testing higher test matrix.
Allow simple parallel execution.
Inspires unattended implementation.
Progresses precision by minimizing human-generated errors.
Saves your money as well as time at the same time.
Q: 3 – Why should you use Selenium as a test tool?
The experts have suggested lots of reasons behind choosing Selenium as a testing tool.
It is present as open-source.
Comprises of enormous user base and serving communities.
Selenium is highly compatible with Chrome, Internet Explorer, Firefox, and others.
Show pronounced compatibility with different platforms named as Mac OS, Linux, Windows, etc.
Highly support diverse programming languages like Java, Ruby, Python, etc.
Comprises of recent and steady repository developments.
Superbly supports distributed testing.
Q: 4 – How many components are there in Selenium?
You should have at least a little idea about Selenium. It is a comprehensive automated testing suite designed basically for supporting automation testing. Being exists as an open-source community; Selenium is widely accepted amongst professionals performing different tests. The tool is present as a package of numerous testing tools and is also referred to as a Suite. Each tool is specially designed for serving the purpose of test requirements. We are mentioning here various sets of tools that you should know.
Selenium Remote Control (RC): It is available as a server, which generally allows users to make test scripts in a programming language.
Selenium Grid: This tool is meant for distributing test execution on various platforms.
Selenium WebDriver: WebDriver has noted benefits as compared to Selenium RC. It is used for communicating with a web browser and makes usage of native compatibility for automation purposes.
Selenium Integrated Development Environment (IDE): It is highly popular as a record as well as a playback tool and widely distributed amongst Firefox Plugin.
Q: 5 – Do you know about testing types that are supported by Selenium?
Selenium is known for supporting certain kinds of testing named – Regression tests and Functional testing.
Q: 6 – What is the perfect time to practice Selenium IDE?
Selenium is one of the pretentious and stress-free tools that come with the package. The offered tool is used for recording and playback the feature that is quite easy to learn with negligible connections. Thus, it is a unique tool meant destined for naïve users.
Q: 7 – Do you have any idea about XPath?
XPath is primarily intended for locating web element works on the XML path. Explaining the XMAL, it defined as Extensible Markup Language. Well, Selenium is used by experts for storing, transporting, and organizing arbitrary data. The best thing about it is that it stores data in the form of key-value pairs, just like HTML tags. Therefore, XPath is ideal for locating HTML elements.
Q: 8 – Are there any limitations related to Selenium?
There are noted limitations linked to Selenium mentioned as –
Highly supports web-based application testing procedures.
You cannot test mobile applications by Selenium.
Selenium is not used for testing Barcode and Captcha.
Some of the third-party tools like JUnit and TestNG that only be used for generating reports.
It is present as a free tool. Hence, you cannot find ready support given by the vendor via the user to help different communities.
Q: 9 – What are the types of waits present in WebDriver?
In general, there are two kinds of waits given in WebDriver.
Talking about Implicit waits, it is widely used for offering a default waiting time basically of about 30 seconds. It is provided in between every consecutive test step around entire test scripts.
According to the experts, explicit waits are generally used for halting the execution up till a particular condition doesn’t meet. They are basically applied for a specific instance.
Q: 10 – Do you know about different kinds of locators in Selenium?
The locator is defined as an address designed for identifying web elements within a webpage. So, it becomes essential to learn about types of Selenium in a precise manner. Some of the locators are –
Q: 11 – When should a Selenium Grid be used?
Selenium Grid is defined for executing different or similar test scripts while using multiple platforms along with browsers. Thus, it helps attain dispersed test execution under several environments.
Q: 12 – What is the fundamental difference between verify commands and assert?
Verify – Verify acts as a command inevitable to check either the given condition is false or true. Regardless of the condition, the program cannot be halt. If there is any failure that not at all means, execution will stop.
Assert – Assert is a command also used for checking the condition. In case the condition is right at that time, the program control is further taken to the next test step. If the condition comes out to be false, then execution will not be stopped, and the test will also not be done further.
Q: 13 – Tell us about different kinds of Drivers present in WebDriver
The WebDriver is generally available in numerous drivers like –
Internet Explorer Driver
HTML Unit Driver
Q 14: What is meant by Selenium 3.0?
The latest version of Selenium is Selenium 3.0. It has been introduced by adding 2 beta versions of selenium 3.0 along with more features.
Q 15: What is the difference between the terms single and double slash in X-path?
Single slash, i.e., / starts selection from the document node. It permits users to establish absolute path expressions.
Double slash, i.e., //, starts collection matching everywhere in a document. It allows for developing relative path expressions.
Q 16: Can you explain keyword-driven?
This framework is used to develop data tables and keywords along with independent test automation. It may be noted that in the case of keyword driven, the functionality of every app under test is listed in a table. It also offers one by one instruction for every test.
Q 17: What is meant by the data-driven framework?
In the data-driven framework, the test data becomes separate and keeps outside the test scripts; however, test case logic keeps in the test scripts. Kindly note that test data is read from external files only and even loaded into variables that are available in the test script. In this case, variables are used for verification values along with input values.
Q 18: What is meant by the same-origin policy? How can it possible to avoid this policy?
For security reasons, the Same Security Policy has been introduced. It gives a guarantee that a script or another site will not access the content of a website. Accordingly, the same-origin policy, when a code is loaded within a browser, it can run within that website’s domain.
The proxy injection method is used to avoid the same-origin policy. In this method, the Selenium server is used as a client configured HTTP proxy that acts intermediate between the application and browser under test.
Q 19: Does it possible to prepare a customized HTML report with TestNG in the hybrid framework?
Yup! It is possible in three ways;
TestNG: With inbuilt default.html, it is possible to get the HTML report. Moreover, XST reports from Selenium, ANT, and testing combinations are also possible.
Junit: It is possible with ANT only.
Moreover, with our customized reports like XSL jar, it is possible to convert XML content to HTML.
Q 20: Explain the technical challenges of Selenium?
Selenium doesn’t support the Bitmap comparison while it supports web-based applications.
In case of any reporting-related capabilities, it has to rely on third-party tools.
It doesn’t have any object repository concept that makes the maintainability of objects quite tricky.
Q 21: How can it feasible to use a recovery scenario with Selenium?
The fact, recovery scenarios rely upon the programming language that is in use. In a case, users use Java; then they have to use exception handling to eliminate the same. Moreover, with ‘Try catch block’ for web driver Java tests within selenium.
Q 22: What is meant by object repository?
It is a necessary entity that is present in any UI automation that permits a tester to score all objects that are needed in the scripts in single or many centralized locations instead of assembling all over the test scripts.
Q 23: How does Selenium Grid work? Does it workable for performance testing?
It is used to send the tests to the hub. These tests are used to redirect to the Selenium web driver that is used to launch the browser and execute the test. With the whole test suite, it endows to perform tests in parallel.
Yup! It can use for performance testing. However, it is not workable like dedicated performance testing tools such as LoadRunner.
Q 24: Name the different kinds of locators?
Q 25: What do you mean by JUnit Annotation? Which are its different types?
When a particular form of syntactic meta-data is added to Java Source code in JAVA, it is known as annotations. Packages, variables, methods, parameters, etc. are some sorts of annotations. JUnit annotations are used for:
Q 26: Do we use a screen coordinate along with a click command?
When there is a need to click on a particular part of the element, it is essential to use clickAT command. This command permits the element locator. Moreover, x and y coordinates as arguments- clickAT, i.e., cordString, locator.
Q 27: How can you differentiate between getWindowhandles() and getwindowhandle()?
When there is a requirement to receive the address, the open browser and also its return type is Set, then getwindowhandles() is used. However, when there is a need to receive the address of the current browser having control is along with having string as a return type, then getwindowhandle is used.
Q 28: Why do testers essential for Selenium instead of QTP?
The fact, Selenium is more famous than QTP because:
Selenium supports testing web-based applications, but QTP supports client-server applications as well.
Selenium is open-source while QTP is considered a commercial tool.
Selenium supports several programming languages such as Perl, Ruby Python while QTP supports VB script language
Selenium IE, Safari, and Firefox on operating systems such as Mac, Windows, etc. while QTP supports only Internet Explorer on Windows.
Q 29: Can you explain JUnit’s annotation linked with Selenium?
@public void method (): With annotations, @ test specifies that this method is a test method environment.
@Before public void method (): This method is used to prepare the examination.
@After public void method (): When there is a need to execute a technique, this annotation is used. Before starting a test method, [email protected] must be used.
Q 30: Does it possible to receive data from a particular HTML table cell in Selenium IDE?
Yup! It is possible to get data by using the ‘StoreTable’ command.
What are the reasons for the failure of the Selenium IDE test?
In a case, element Selenium IDE seeking to access. However, it does not appear on the webpage, along with operations that are timed-out.
In an example, the locator has amended; however, Selenium IDE can’t locate the element.
In a case, Selenium was trying to access; yet, it was not created.
Q 31: Name the four-parameter that we have to pass in Selenium.
Q 32: How it possible to retrieve the message in an alert box?
To read a message in an alert box, make sure to use the store alert command that fetches the message of the alert pop up first, then store it in a variable.
Q 33: Name two modes of views that are used in Selenium IDE?
It is possible to open selenium IDE either by way of the sidebar or pop-up window.
Q 34: Name the element locators in Selenium IDE to find out elements on a web page?
There are four locators used that are;
Q 35: How it feasible to convert any selenium IDE tests that are from selenite to another language?
With the assistance of the format option of selenium IDE, it is feasible to convert tests into another programming language.
Furthermore, the users can use the format option of Selenium IDE whenever there is a need for the conversion of tests into another programming language
Q 36: How can you run a single line from Selenium IDE?
It is possible in two ways such as;
The first option select ‘Execute this command’ by right-clicking on the command available in Selenium IDE.
The second option is to press ‘X’ key on your keyword once you selected the command in selenium IDE.
37: What are meant by core extension?
Core extensions are also known as ‘User Extension.’ When there is a need to extend the default functionality offered by the Selenium function library, then we need to create a core extension; To create a core extension, it is possible to download readymade core extensions developed by other selenium enthusiasts.
Q 38: How is it possible to work with different or multiple windows in Selenium?
It is possible to switch between windows by using a command known as the select window. This command used the title of windows to know which window needs to change.
Q 39: Differentiate Thread.sleep () and setSpeed () methods
The fact, both delay the speed of execution. In Thread. Sleep () stops the current thread for a particular period. It is done only once. Moreover, Thread.sleep () supports a single argument in an integer format. Also, it doesn’t wait more than one time after getting a command at sleep.
SetSpeed (): It is used to halt the execution of each selenium command in a particular amount of time. Like Thread. Sleep, SetSpeed also doesn’t welcome a single argument in an integer format.
Q 40: How can users insert a breakpoint in Selenium IDE?
First, users need to select ‘Toggle Break Point’ just by right-clicking on the command in Selenium IDE. Then press the key ‘P’ on the keyboard and then select a command in Selenium IDE. Moreover, it is possible to choose multiple breakpoints in Selenium IDE.
Q 41: Explain the term Selenese and name its different types?
It is a selenium set of commands that are used to execute the test. There are three types of selenite that are:
The assertion that is used as checkpoints;
Actions that are used to perform the tasks and interactions with the target elements;
Accessors that is used to store the values in a variable.
Q 42: To show a script in Selenium IDE, which format should be used?
To get the Selenium IDE source view, users must show their script in XML format.
Q 43: How it possible to debug the tests in Selenium IDE?
First, insert a breakpoint from the area where the users need to run step by step, then execute the test case.
At some particular breakpoint, it is possible to halt the execution.
For the next level, select the blue button and for running commands at a time, choose the run button.
Q 44: Which command is used to entering values onto text boxes?
We use the command name is sendkeys () to enter values onto text boxes.
Q 45: How can it possible to run the selenium server by using anything other than using default port 4444?
With the help of java-jar selenium-server.jar-port, it is possible to run a selenium server without using default port 4444.
Q 46: Tell me how it is possible to capture server-side log selenium server
By using this command java –jar .jar –log selenium.log, it is possible to capture the server-side log selenium server.
Q 47: What are the technical disadvantages of using selenium RC?
Aside from using the ‘Same Origin Policy,’ selenium is also restricted to exercise anything that is from an outside browser.
Q 48: How does it feasible to handle pop-ups in RC?
With the assistance of the select window method, it is possible to get a pop-up window, while with the window focus method, it is possible to gain control from the current window to pop one. Furthermore, it is also possible to perform actions as per scripts.
Q 49: With selenium, how does it possible to handle network latency?
With driver.manage.pageloadingtime, it is possible to handle network latency in selenium.
Q 50: What is meant by IntelliJ?
It is an IDE that assists in writing faster and better code for selenium. It can also be used in the option of Eclipse and Java Bean.
To clear an interview related to Selenium is not a dream now. With these 50 selenium interview questions and answers, it will become easy for the interviewers to crack this interview in the first attempt. These have been explained in an inaccurate and straightforward manner. After Selenium Training thoroughly read these questions and answers before your interview days.
We also provide Online Selenium Training.
All the best!
Get well prepared!
- End Your Selenium Certification Pune Search With 3RI Selenium Training In Pune!
- SAP ABAP Interview Questions & Answers
- SAP FICO Interview Questions & Answers
- SAP MM Interview Questions & Answers
- AngularJS Interview Questions & Answers
- Python Interview Questions & Answers
- Blockchain Interview Questions and Answers
- Selenium Interview Questions and Answers
- MEAN Stack Interview Questions and Answers
- Best Technologies To Learn In IT Industry 2020