Selenium Interview Questions and Answers

Selenium Interview Questions and Answers

Selenium Training in Chennai provides training in the web driver, IDE, grid, and continuous integration testing. Agile methodology and DevOps work culture are highlighting the need of testing in the software industry. Different tools like Selenium, testingWhiz, HPE Unified functional Testing, TestComplete, Ranorex, Sahi, Watir, and Tosca test suite are used for the different types of testing projects. Let me discuss in detail about the interview questions for Selenium Training.

  1. What are the different types of automation testing?

Regression testing, smoke testing, and sanity testing are different types of automation testing.

  1. What are the maximum numbers of test cases that can be automated per day?

The number of test cases automated per day by the tester depends upon the complexity of the web application. In general, it is estimated that tester automate 2 to 5 test scenarios per day if the complexity is low. One or fewer test cases are expected if the complexity is high. Selenium Course in Chennai helps to prepare for the interviews with the practical oriented training.

  1. What are the different types of the testing framework?

Data-driven testing framework, keyword driven testing framework, and hybrid testing framework are the three types of testing frameworks.

  1. Explain the process of how the automation framework is used?

The test automation framework starts from the process as the programming language, framework used, test base class, element locators, tests- page objects, page factory, utility functions file, property files, Test NG annotations, how we parameterize tests using excel files, Test NG annotations, parameterize tests using excel files, error screen shots, generating reports, e-mailing reports, version control system used and continuous integration tool.

  1. What are the reasons to select the selenium automation tool?

Free and open source, have a large user base, cross-browser compatibility, platform compatibility, and the support to the multiple programming languages such as Java, pearl, python, PHP and C#.

  1. What are the components of selenium?

Selenium IDE, Selenium RC, selenium WebDriver, and selenium Grid are the four components of selenium.

  1. Explain Selenium IDE?

Selenium IDE is the fire fox plugin and simplest framework in the selenium suite. Selenium IDE is used for creating scripts or test cases and Selenium RC or selenium Web Driver are used for more advanced or robust test cases.

  1. Explain Selenese?

In the selenium IDE, selenese language is used to write the test scripts. Best Selenium Training in Chennai aid the students to get placed in the top companies.

  1. Which browser supports selenium IDE?

FireFox is the only browser which supports the selenium IDE.

  1. Explain Selenium Web Driver?

Selenium Web Driver AKA selenium 2 accepts the commands and sends them to a browser. It directly communicates with the browser and it is implemented through a browser-specific driver. Selenium Web Driver supports multiple languages like Java, C#, PHP, Python, Perl, and Ruby and it is the frame work for automating the web application.

  1. Explain the Selenium Grid?

Selenium Grid is used to run the tests in different machines against the different browsers and it is used together with Selenium RC. It is used to run the test in multiple platforms and environments like different machines, different browsers and different operating systems.

  1. Describe the hub in Selenium Grid?

A hub is a server which controls the test execution in multiple machines.

  1. Explain node in Selenium Grid?

Node is the machine which is attached to the hub and there can be multiple nodes in a single selenium Grid. Best Selenium Training Institute in Chennai with the best reviews from the students conducts the classes with peer approach and practical approach.

  1. List the different types of Web Driver APIs available in selenium?

Firefox Driver, Gecko Driver, Internet Explorer Driver, Chrome Driver, HTML Unit Driver, Opera Driver, Safari Driver, Android Driver, iPhone driver, and event firing web driver are some of the Web Driver APIs in selenium.

  1. Name the open-source frameworks supported by the Selenium WebDriver?

JUnit and TestNG are the open-source frameworks supported by the selenium web driver.

  1. What are the locators available in the Selenium WebDriver?

ID, ClassName, Name, Tagname, LinkText, PartialLinktext, Xpath, and CSS selector are the locators in the Selenium Web Driver.

  1. Which web driver is the fastest web driver?

The HTML unit driver helps for the fastest implementation of the web driver. The HTML unit driver does not execute the tests in the browser.

  1. Name the programming languages which selenium supports?

The programming languages which selenium support are Java, C#, Python, Ruby, Perl, and PHP are the programming languages used in the selenium.

  1. List out some of the disadvantages of the selenium testing?

Selenium is not used for the windows application and mobile apps, the reporting tools are limited, it handles dynamic elements, it is difficult to handle the page load, pop-up windows and the captcha are difficult to handle in the selenium.

  1. Describe the XPath?

To locate the elements XPath is used. In an XML document to locate the web elements XPath is used. Textbox, button, checkbox, and image are the web elements in a web page.

  1. What is the difference between single slash and double slash in selenium?

Single slash is used to create XPath with the obsolete path and the X Path is used to create the document from the node or the start node. Double slash is used to create the X path with relative path and X path is used to select anywhere within the document.

  1. Differentiate between the absolute path and the relative path in selenium?

The process of the absolute path is from the root node until the desired descendant element’s node. The process of the relative path is it starts from the HTML node and ends with input node.

  1. Differentiate assert and verify in selenium?

The condition in the assert is true then the program will execute the next step in the test and if it is false then it will stop. Similarly, in Verify there is no connection between the condition and the test execution.

  1. Explain the soft assert and the hard assert in selenium?

The soft assert collects the errors and it does not throw an exception when an assert fails whereas hard assert throws an Asser exception immediately and the test suite continues after the assert statement fail.

  1. Mention the verification points in the Selenium?

The verification points in the selenium are the page title, certain text, and the certain element are some of the verification points. There is no coding for the verification and it is the built-in feature of the selenium

  1. Explain how text is derived in the web element?

The getText() method is used

package softwareTestingMaterial;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.annotations.Test;

public class TestTestTest {

 @Test

 public void testmethod(){

 System.setProperty(“webdriver.chrome.driver”, “D:\\Selenium Environment\\Drivers\\chromedriver.exe”);

   WebDriver driver = new ChromeDriver();

   driver.get(“https://www.google.com”);

   String availableText = driver.findElement(By.xpath(“//*[@id=’gbw’]/div/div/div[1]/div[1]/a”)).getText();

   System.out.println(“Text Available is :”+availableText);

  1. How to run the web driver scripts in the selenium?

To distribute the selenium webdriver scripts in the selenium the selenium grid selenium server is used.

  1. Explain the meaning of the command driver.get (“www.softwaretestingmaterial.com”) in the selenium?

The meaning of this is that an exception is thrown and it is required to pass HTTP protocol within the driver.get() method. driver.get.

  1. How to open an URL in Selenium WebDriver?

driver.get() method is used to open an URL in the Selenium WebDriver and the alternative method is driver.navigate.to (“URL”).

  1. Differentiate driver. get () and driver.navigate.to(“URL”) in the WebDriver?

driver.get() is used to open an URL and till the page gets loaded it will wait whereas in the case of the driver.navigate.to() the URL will not wait till the whole page gets loaded. driver.navigate.to() is used to navigate an URL.

  1. What are the methods used to move back, forward and refresh a page in the Selenium WebDriver?

driver.navigate().forward(); is used to navigate forward as per the browser’s history, driver.navigate().back(); is used to move back with reference to the browser’s history, driver.navigate().refresh(); is used to refresh the current web page and helps to reload the web elements, driver.navigate().to(“URL”); is used to launch a new web browser window and navigate to the specified URL in the selenium.

  1. What is the command to fetch the current page URL in Selenium?

The get current URL () is used to fetch the current page URL and the command is driver.getCurrentUrl();

  1. How to maximize the browser window in the selenium?

The browser window in selenium is maximized with Maximize() method.

  1. What is the method used to delete cookies in Selenium?

delete all cookies() method is used to delete the cookies in the Selenium.

  1. Mention the different ways to refresh a browser in the Selenium WebDriver?

driver.navigate(), driver.getCurrentUrl(), and driver.navigate(), and the sendkeys are used to refresh a page in the Selenium.

  1. State the difference between the driver.getWindowHandle() and driver.getWindowHandles() in Selenium WebDriver?

driver.getWindowHandle() returns a handle of the current page driver.getWindowHandlesis used to return a set of handles of the all the pages available in the web driver.

Comments are closed.