Selenium Question and Answers

Selenium Question and Answers

Q.1Does selenium require Java?

No, Selenium does not require Java.

Selenium is written in the Java programming language, therefore understanding the Java programming language is beneficial to understanding Selenium internals.

Selenium allows you to write test cases in any programming language you want, including C#, PHP, Python, and others.


Q.2How come Selenium Automation Tool is preferred?

The following are some of the reasons why you should use the Selenium Automation Tool:

1. It is open source and free.

2. It has a vast user base and a reputation for assisting communities.

3. It is compatible with all major browsers.

4. It is cross-platform compatible.

5. It supports a variety of programming languages, including Java, Perl, Phyton, Php, C#, and others.


Q.3How does Selenium make advantage of xpath?

Selenium's XPath

The HTML DOM data structure is used to locate items on a webpage.


XPath becomes XML Path. The Selenium selector XPath is used to pick certain items on a web page. For discovering elements on a webpage, XPath uses an XML path expression.


Selenium's most popular selector is XPath.


Q.4What does Selenium IDE mean to you?

Selenium IDE is a Firefox plugin that stands for Selenium Integrated Development Environment. The Selenium IDE framework is the most basic in the Selenium Suite.


It allows you to record and playback scripts. Although Selenium IDE allows us to build scripts, we must use Selenium RC or Selenium WebDriver to write more advanced and comprehensive test cases.


Q.5Can Python be used in Selenium?

Yes, Selenium is helpful.

Python is an open-source programming language.


Selenium includes a Python driver that allows you to create test cases for web applications using the Python programming language.


The following Python frameworks are supported by Selenium.





framework for robots


Q.6What is your definition of Selenium RC?

Selenium RC or Selenium Remote Control was one of the main Selenium project for a long time period prior to the WebDriver merge brought up Selenium.


Q.7What is Selenium WebDriver and how does it work?

Selenium WebDriver is a browser automation framework that takes user input and sends it to a browser. A browser-specific driver is used to implement Selenium WebDriver.

As a result, it is able to control the browser by interacting directly with it. Java, C#, PHP, Python, Perl, and Ruby are all supported by Selenium WebDriver.


Q.8What is the definition of Selenium Grid?

Selenium Grid is referred as a tool used together with Selenium RC used to run tests on different machines against different browsers in parallel.

In other words, running multiple tests at the same time against different machines running different

Browsers and operating systems are two examples. It is generally used to distribute the execution of your tests across multiple platforms and environments at the same time.


Q.9When should Selenium Grid be used?

Selenium Grid is generally used to distribute test execution by running the same or different test scripts on several platforms and browsers at the same time.


Q.10Can you tell me more about Selenium Automation Testing?

Selenium Automation Testing entails utilising the Selenium automation tool to test a web application against many web browsers and versions, such as Chrome, Firefox, Safari, and others.

With the rise of the internet and e-commerce, web application development and testing on many web browsers and versions is in high demand.

Selenium is an open source tool that automates this time-consuming task.

Selenium also allows you to develop programmes for your test cases. C#, PHP, Python, and other programming languages are available.


Q.11Which WebDriver implementation claims to be the most efficient?

Because HTMLUnitDriver does not conduct tests in the browser, it claims to be the fastest implementation of WebDriver.


Q.12How well do you understand XPath?

The most common usage of XPath is to locate elements. We may use XPath to navigate between elements and attributes in an XML document and find web elements such as textboxes, buttons, checkboxes, and images in a web page.


Q.13 In Selenium, can you tell the difference between "/" and "/"?

Single Slash "/" – A single slash is typically used to create an XPath with an absolute path, which implies the XPath will begin with the document node/start node.

Double Slash "//" – Double slash is used to create XPath with relative values.

This means that the XPath will be built to allow selection to begin anywhere in the document.


Q.14In Selenium, which verification points should be considered?

In Selenium IDE, the Verify and Assert commands are used as Verification points. There are no built-in features for verification points in Selenium WebDriver.

It is entirely dependent on the coding style employed. The following are some of the verification points: 1. Look for the page title
2. Look for a specific sentence 3. Look for a specific element (text box, button, drop down, etc.)


Q.15How will you use Selenium WebDriver to run a browser?

Selenium WebDriver is an interface that allows us to generate an object of a needed driver class, such as FirefoxDriver, ChromeDriver, or InternetExplorerDriver.

1. To start Firefox Driver, follow these steps:
new FirefoxDriver(); WebDriver driver = new FirefoxDriver(); 

2. To use ChromeDriver, call WebDriver driver = new ChromeDriver().

3. To use the Internet Explorer Driver, use the following code: WebDriver driver = new InternetExplorerDriver();

4. To use SafariDriver, type WebDriver driver = new SafariDriver().
If you're using the geckodriver with Selenium, you'll need to upgrade to version 3.3.


Q.16How would you tell the difference between get() and navigate.to("url")?

The following are the points of distinction:
When you use driver.get() to open a URL, it will wait until the entire page has loaded. driver.navigate.to() is a function that navigates to a URL without waiting for the entire page to load.


Q.17 Can you travel back and forth in a browser using Selenium WebDriver?

To move back and forth in a browser, we can use the Navigate interface. The techniques to go back, forward, and refresh a page are listed below.

1. driver.navigate().forward(); – This function is used to travel to the next web page using the browser's history.

2. driver.navigate().back(); – This method is used to return to a previous webpage using a reference to.

the history of the browser

3. driver.navigate().refresh(); – It is used to reload all of the web elements by refreshing the current web page.

4. url = driver.navigate().to("url"); It's used to open a new web browser window and go to a specific URL.


Q.18 In Selenium WebDriver, how can we take a screenshot?

Test cases may fail during the execution of the test scripts. You can simply capture a screenshot and save it in a result repository while manually executing the test cases. Selenium WebDriver can be used to accomplish the same thing.

The following are some circumstances that need the use of Selenium WebDriver to capture a screenshot:

1. Application troubles

2. Inability to Make an Assertion

3. Finding Webelements on the web page is difficult.

4. Take a break to look for Webelements on the page.

In addition, selenium provides a user interface known as

TakesScreenshot contains a method called 'getScreenShotAs' that may be used to capture a screenshot of the programme being tested.

When capturing screenshots in Selenium 3, there's a chance you'll run into some problems. We can utilise the aShot utility to get around this problem.


Q.19How will you deal with pop-up windows?

Selenium does not support programmes that run on Windows. Because it is an automation test, both tools only allow web application testing.

Selenium can also manage windows-based popups with the help of third-party products like AutoIT and Robot class.


Q.20How do you read test data from an excel spreadsheet?

Using JXL or the POI API, we can easily read test data. POI API has a number of advantages over JXL.

Follow Us on!

How can we help you?

To request a quote or want to meet up for a course discussion, contact us directly or fill out the form and we will get back to you promptly.