TOP 25 SELENIUM INTERVIEW
QUESTIONS AND ANSWERS
PRESENTED BY TESTBYTES
WWW.TESTBYTES.NE T
1.WhatisSelenium?
>Selenium is a WebDriver Automation tool
which is used to test web-based
applications via automating the test
procedure.
>It supports various browsers,
programming languages, and platforms.
WWW.TESTBYTES.NE T
2.WhatisAutomationTesting?
>Automation Testing is a procedure for
automating the manual steps or process to
test the application or software.
>It requires an additional testing tool to
create test scripts that can be executed
repeatedly.
WWW.TESTBYTES.NE T
3.Whydoweneedsoftwaretesting?
>Once an application is developed, it is
mandatory to check whether that
application contains any errors or not.
>Software testing provides a tester to
check for substantial errors or bugs in the
application and resolves it
WWW.TESTBYTES.NE T
4.WhenwillyouchoosetouseSeleniumGrid?
>When there are multiple tests to be
executed, we will use selenium grid.
>It will enable us to run same test scripts
on multiple platforms simultaneously and
thus reducing the time consumption.
WWW.TESTBYTES.NE T
5.CanyouillustratethedrawbacksofSelenium?
>It cannot be used for desktop applications
testing.
>Also, it cannot perform on test on web
services.
>To create vigorous scripts, knowledge of
programming languages is required.
>External libraries are required to perform
tasks in Selenium.
WWW.TESTBYTES.NE T
6.NamethetypesoftestinginSelenium?
>Regression Testing
>Functional Testing
>Load Testing
WWW.TESTBYTES.NE T
7.CanyoutestAPIsorwebservicesusingSelenium
WebDriverandwhy?
>No, we cannot test web services using
Selenium.
>Web services are headless and it only
uses browser’s class method to automate
web applications. Thus it cannot automate
web services.
WWW.TESTBYTES.NE T
8.WhenwillyouchoosetouseSeleniumIDE?
>When there is repetition in the test
procedure and we want to run the same
sequence over and over again.
>Selenium IDE provides record and
playback feature which we can use to run
tests repeatedly in the same sequence.
WWW.TESTBYTES.NE T
9.WhatisXPathinSelenium?
>X Path is a locator which uses XML path
to locate a web element in Selenium.
>It can also be used to locate HTML
elements. X Path uses references from
another element to find the specific
element in a web page.
WWW.TESTBYTES.NE T
10.Whatisthebasicdifferencebetweenabsolute
andrelativeXPath?
Absolute X Path: It uses a complete path
starting from the node of the root element
to go to the desired element.
Relative X Path: It only uses references
from another element to go to the desired
element.
WWW.TESTBYTES.NE T
11.Haveyoueverautomatedtestcases,Ifyes,how
manyperday?
>Yes, I’ve automated test cases and on
average I can automate 3-5 test cases each
day.
>Although, these test cases can be
sometimes complex and lengthy that can
take a day to complete.
WWW.TESTBYTES.NE T
12.Canyounamethelatest Seleniumtool andits
use?
WebDriver is the latest selenium tool used
to automate web applications testing and
checks whether it is working as expected
or not.
WWW.TESTBYTES.NE T
 13.Canyoustatethedifferencebetweenregression
andfunctionaltesting?
>Regression Testing: Regression testing is
a repeated test of an already tested
program.
>Functional Testing: Functional testing
usually ensures the functionality of the
software program.
WWW.TESTBYTES.NE T
14.WhatistheuseofTestNGinSelenium?
>TestNG in Selenium is used to cover a
wide range of test categories such as
functional, unit, end-to-end etc.
>Using TestNG we can easily generate a
proper report of test cases and can easily
gather the information of how many test
cases were passed, failed or skipped.
WWW.TESTBYTES.NE T
15.CanweverifytheimageusingSelenium?
>No, we cannot verify the image in
Selenium but we can easily verify whether
the image is displayed or not using
properties.
WWW.TESTBYTES.NE T
16.Canyoustatethedifferencebetween‘Type’and
‘TypeAndWait’command?
>Type: When the user needs to enter the
text into a text field, type command is
used.
>TypeAndWait: This command is generally
used to reload the web page as soon as the
typing of text is completed.
WWW.TESTBYTES.NE T
17.HowwillyoutakescreenshotsusingSelenium?
We can easily take screenshot using
TakeScreenShot function with
getScreenshotAs() method.
>Example:File scrFile =
((TakeScreenshot)driver).getScreenshotAs(
screenshot.JPG);
WWW.TESTBYTES.NE T
18.Canyougobackandforthinthebrowserusing
Selenium?
Yes, we can easily use the following
commands to move back and forth in the
browser using Selenium:
>navigate().back()
>navigate().forward()
WWW.TESTBYTES.NE T
19.Canyougobackandforthinthebrowserusing
Selenium?
Yes, we can easily use the following
commands to move back and forth in the
browser using Selenium:
>navigate().back()
>navigate().forward()
WWW.TESTBYTES.NE T
20.HowwouldyoudeletethecookiesusingSelenium?
>To delete the cookies, we will use
deletedAllCookies() command.
Syntax: driver.manage().deleteAllCookies();
WWW.TESTBYTES.NE T
21. Writethecodetodouble-clickanelement?
Actions action = new Actions(driver);
WebElement element
=driver.findElement(By.id(“elementId”));
action.doubleClick(element).perform();
WWW.TESTBYTES.NE T
22.Canyoulistallthenavigationsmethodswhichare
usedinSelenium?
Yes, the following are the different
navigation methods use in Selenium:
Syntax
driver.navigate().to(String
url);driver.navigate().refresh();
driver.navigate().forward();
driver.navigate().back();
WWW.TESTBYTES.NE T
23.HowwillyouperformdraganddropinSelenium?
Actions action = new Actions(WebDriver);
action.dragAndDrop(sourceWE, destWE)
WWW.TESTBYTES.NE T
24.Howwillyouverifywhethertheelementis
visibleornot?
To verify whether the element is visible or
not, we’ll use following syntax:
WebElement e = driver.findElement();
boolean result = e.isDisplayed();
WWW.TESTBYTES.NE T
25.Howwillyouclearthetextwhichiswrittenina
textbox?
We will use clear() command to clear the
text which is written in a text box.
Syntax: driver.findElement(By.id(“element
Locator”)).clear();
Contact Details
Mailing address
Kalas road, Vishrantwadi, Pune, Maharashtra-411015
Email address
info@testbytes.net
Phone number
+91 811 386 5000

Top 25 Selenium Interview Questions and Answers 2018