Best Selenium Interview Question and Answers

Orange TechnoMind 14-Mar-2019
orange technomind

 

1.What is Selenium?

Selenium is an open source web automation framework which can used to perform testing web applications. Selenium works on multiple browsers like Chrome, Firefox, IE, Edge, Safari etc.It works with Java, C#, Perl, Ruby, Python and Groovy programming languages to automate the browser activities.

2.What is the latest version of Selenium ?

Selenium 3 is the latest version.

3.What are the different components in Selenium ?

Selenium comprises of 4 different components  are Selenium IDE, Selenium RC, Selenium WebDriver and Selenium Grid.

4.Which are the Operating Systems supported by Selenium?

Selenium IDE

Works in Firefox 2+ Start browser, Run tests

Operating Systems Supported:

1. Windows,

2. OS X

3. Linux

4. Solaris

5. Others whichever supports Firefox 2+

Selenium Remote Control

Used for starting browser and run tests

Operating Systems Supported:

1. Windows,

2. OS X

3. Linux

4. Solaris

5. Others

Selenium Core

Used for running tests

Operating Systems Supported:

1. Windows,

2. OS X

3. Linux

4. Solaris

5. Others

5.What are Selenium supported browsers?

Selenium WebDriver API has a many special drivers to check your web application in different browsers. here are the listing of Selenium Webdriver supported browsers are

•           Internet Explorer

•           Firefox

•           Google Chrome

•           Opera

•           HTMLUnit

6.Which Programming Languages are supported by selenium WebDriver?

Selenium WebDriver could be very wast API and It guide many different languages to write down test cases in your software web application. list of WebDriver supported languages are as follow.

•           Java

•           C#

•           PHP

•           Python

•           Perl

•           Ruby

7.What are the distinct Selenium components?

The following are the sets of Selenium tools :

Selenium integrated development environment (IDE) – it is a Firefox plug-wherein is effortlessly installable in conjunction with different plug-ins. since it has a simple framework, Selenium IDE have to be used as prototyping device. For superior use instances, Selenium RC or WebDriver would be appropriate.

Selenium Remoter control (RC) – it is a checking out framework that lets in the builders to put in writing the code in any programming language. normally it helps a extensive spectrum of languages like Java, php, Python, Perl, C#, and many others.

Selenium WebDriver – This device has greater advanced functions than that of RC and IDE. It applies higher approach to automate the browser activities. It does now not normally rely on JavaScript, it interacts with browser.

Selenium Grid – it works together with Selenium RC and runs checks on special nodes the use of one-of-a-kind browsers simultaneously.

8.Which Different Element Locators Supported By Selenium WebDriver?

Selenium WebDriver supports following element locators

•           XPath Locator

•           CSSSelector Locator

•           ClassName Locator

•           ID Locator

•           Name Locator

•           LinkText Locator

•           PartialLinkText Locator

•           TagName Locator

9.How to press ENTER key button on text box in selenium webdriver?

driver.findElement(By.id("input")).sendKeys(Keys.ENTER);

What are the types of synchronization techniques in selenium WebDriver?

There are two types of synchronization techniques available in selenium WebDriver.

1.         Implicit Wait

2.         Explicit Wait

10.What is Implicit Wait In Selenium WebDriver?

using Implicit wait in webdriver software program checking out test case, we are able to ballot the DOM for positive amount of time when some element or factors are not available straight away on website.

11.What is explicit Wait In Selenium WebDriver?

The use of explicit wait code in selenium webdriver automation checking out device, you may define to watch for a sure situation to occur earlier than proceeding in addition check code execution.

12.What test can Selenium do?

Selenium is basically used for the functional testing of web based programs. it could be used for testing within the continuous integration environment. it is also useful for agile testing

13.What is the difference between GET and NAVIGATE to open a web page in selenium?

You can use both methods to navigate to a URL.We use commonly driver.get(“url”) to load the webpage. Every time we use this command, the page will be refreshed.which loads a new web page in the current browser window whereas driver.navigate().to(“url”) navigates to the page by changing the URL like doing forward/backward navigation. driver.get() never stores browser history whereas driver.navigate().to() stores browser history so as to be used for other commands.

14.What are the features of TestNG?

TestNG is a testing framework designed to simplify a broad range of testing desires, from unit testing (trying out a category in isolation of the others) to integration testing (testing entire systems made from several classes, numerous programs and even numerous outside frameworks, which include application servers). you can use test suite,annotations, automatically generation of document and lots extra.

15.How to type text in text box or text area?

driver.findElement(By.name("fname")).sendKeys("My First Name");

16.How to get page title?

driver.getTitle();

17.How to get Current Page URL?

driver.getCurrentUrl()

18.Can Selenium automate Desktop Applications ?

No. Selenium can only automate Web Applications.

Examples: Web Applications like Facebook.com, Gmail.com etc can be automated by Selenium. Where as the Desktop Applications like Paint, Skype, MS Office etc. cannot be automated by Selenium.

19.What is the difference between Absolute XPath and Relative XPath Expressions ?

Absolute XPath is the Complete path from the Root Element to the desire element.whereas Relative Xpaths are not complete path we can provide direct path to the UI elements.If simple changes in the applications functionality then the complete path in absolute XPath may change. but Relative XPath is the direct path, its path won't change with the simple changes in the application.

20.How do you add check points or verification points in Selenium?

Check points or verification points are known as Assertions in Selenium. The keywords with below mentioned prefix will be used for adding check points or verification points.

1. verify

2. assert

3. waitFor

21.What is Selenese?

Selenium set of commands which are used for running the test are called as Selenese.

There are three types of Selenese, those are:

1. Actions – used for performing the operations and interactions with the target elements

2. Assertions – used as check points

3. Accessors – used for storing the values in a variable

22.What are the types of text patterns available in Selenium?

There are three types of patterns available in Selenium

1. globbing

2. regular expressions

3. exact

23.What are the test types supported by Selenium?

Selenium could be used for testing the web based applications.The test types can be supported are Functional, Regression,Load testing. The automation tool could be implemented for the post release validation with a continuous integration tools like Jenkins, Hudson, QuickBuild or cruiseControl.

24.How do I submit a form using Selenium?

WebElement el = driver.findElement(By.id("ElementID"));

el.submit();

25.What are the driver.close and driver.quit in WebDriver? Which is more preferable?

Both are used to close the browser session in Selenium WebDriver.

driver.close – To close the browser window on which the focus is set.

driver.quit – To call the driver.dispose method that closes all the browser windows and ends the WebDriver session gracefully.

26.Can we automate desktop software application's testing using selenium WebDriver?

No,This Is the biggest disadvantage of selenium WebDriver API. We can automate only web and mobile software application's testing using selenium WebDriver.

27.Which one is fastest in Selenium WebDriver?

HTMLUnit Driver Is faster than all other drivers because It Is not using any UI to execute test cases of software web application. Internet Explorer driver Is slower than Firefox and HtmlUnit driver.

28.How to export Selenium IDE Test Suite to Selenium RC Suites?

The languages supported by Selenium IDE Test Suites are .Net,Java,Perl,Python,PHP,Ruby.The below mentioned steps can explain how to export the test suites

1. Open the test case from Selenium IDE

2. Select File -> Export Test Suite As

29.Can we perform drag and drop operation In Selenium WebDriver?

 Yes, We can perform it by Advanced User Interactions API.

 Example : new Actions(driver).dragAndDrop(X, Y).build().perform();

30.What are the different types of automation frameworks?

There are different types of automation frameworks and the most common ones are

  1. Data Driven Testing Framework
  2. Keyword Driven Testing Framework
  3. Hybrid Testing Framework

Contact Us

If you have a question, we have an answer. If you need something, we'll help you. Contact us anytime.

For enrollment related queries & support

+91 99 40 550 285

For technical issues & support

orangetechnomind@gmail.com