Selenium Interview Question-3
) While injecting capabilities in webdriver to
perform tests on a browser which is not supported by a webdriver what is the
limitation that one can come across?
Major limitation of injecting capabilities is that “findElement”
command may not work as expected.
36) Explain how you can find broken images in a page
using Selenium Web driver ?
To find the broken images in a page using Selenium web driver is
·
Get Xpath and get all the links in the page using tag name
·
In the page click on each and every link
·
Look for 404/500 in the target page title
37) Explain how you can handle colors in web driver?
To handle colors in web driver you can use
Use getCssValue(arg0) function to get the colors by sending
‘color’ string as an argument
38) Using web driver how you can store a value which
is text box?
You can use following command to store a value which is text box
using web driver
driver.findElement(By.id(“your Textbox”)).sendKeys(“your
keyword”);
39) Explain how you can switch between frames?
To switch between frames webdrivers [
driver.switchTo().frame() ] method takes one of the three possible
arguments
·
A number: It selects the number by its (zero-based) index
·
A number or ID: Select a frame by its name or ID
·
Previously found WebElement: Using its previously located
WebElement select a frame
40) Mention 5 different exceptions you had in
Selenium web driver?
The 5 different exceptions you had in Selenium web drivers are
·
WebDriverException
·
NoAlertPresentException
·
NoSuchWindowException
·
NoSuchElementException
·
TimeoutException
41) Explain using Webdriver how you can perform
double click ?
You can perform double click by using
·
Syntax- Actions act = new Actions (driver);
·
act.doubleClick(webelement);
42) How will you use Selenium to upload a file ?
You can use “type”command to type in a file input box of upload
file. Then, you have to use “Robot” class in JAVA to make file upload work.
43) Which web driver implementation is fastest?
HTMLUnit Driver implementation is fastest, HTMLUnitDriver does
not execute tests on browser but plain http request, which is far quick than
launching a browser and executing tests
44) Explain how you can handle frames using Selenium 2.0 ?
To bring control on HTML frame you can use “SwitchTo” frame
method-
driver.switchTo().frame(“frameName”);
To specify a frame you can use index number
driver.switchTo().frame(“parentFrame.4.frameName”);
This would bring control on frame named- “frameName” of the 4th sub
frame names “parentFrame”
45) What is the difference between getWindowhandles() and
getwindowhandle() ?
getwindowhandles(): It is used to get the address of all the
open browser and its return type is iterator<String>
getwindowhandle(): It is used to get the address of the current
browser where the control is and return type is string
Selenium is one of the most popular automated testing tool used to automate various types of applications. Selenium is a package of several testing tools designed in a way for to support and encourage automation testing of functional aspects of web-based applications and a wide range of browsers and platforms and for the same reason, it is referred to as a Suite.
ReplyDeleteSelenium Interview Questions and Answers
Thankyou for the valuable content.It was really helpful in understanding the concept.# BOOST Your GOOGLE RANKING.It’s Your Time To Be On #1st Page
ReplyDeleteOur Motive is not just to create links but to get them indexed as will
Increase Domain Authority (DA).We’re on a mission to increase DA PA of your domain
High Quality Backlink Building Service
1000 Backlink at cheapest
50 High Quality for just 50 INR
2000 Backlink at cheapest
5000 Backlink at cheapest
Any information doctor national information. Region ahead bar. Around space statement low increase president.
ReplyDelete