100 Selenium Webdriver interview questions with answers by www.jobinterviewquestionswithanswers.blogspot.com
100 Selenium Webdriver interview questions with answers by http://jobinterviewquestionswithanswers.blogspot.in/
1. Difference between Absolute path & Relative path.
Absolute path will start with root path (/) and Relative path
will from current path (//)
Absolute xPath : /html/body/div[3]/div[2]/div[2]/div[2]/div[2]/div[2]/div[2]/div/div[4]/div[1]/div/div[@id='main']/div[@id='Blog1']/div[1]/div[1]/div/div[1]/div/h3/a
Relative xPath : //h3/a[text()='Working on New Window']
Relative xPath : //h3/a[text()='Working on New Window']
2. Tell me some TestNG Annotations.
@Test,@Parameters,@Listeners,@BeforeSuite,@AfterSuite,@BeforeTest,@AfterTest,
@DataProvider,@BeforeGroups,@AfterGroups,@BeforeClass,@AfterClass,
@BeforeMethod,@AfterMethod,@Factory
@DataProvider,@BeforeGroups,@AfterGroups,@BeforeClass,@AfterClass,
@BeforeMethod,@AfterMethod,@Factory
3. What are desired capabilities?
Desired Capabilities help to set properties for the Web Driver.
A typical use case would be to
set the path for the Firefox Driver if your local installation doesn't correspond to the default
settings.
set the path for the Firefox Driver if your local installation doesn't correspond to the default
settings.
4. Difference between Selenium RC and
Selenium Web driver.
Difference between Selenium RC
and Selenium Web driver.
Selenium RC
|
Selenium Web driver
|
Selenium
RC’s architecture is way more complicated.
|
Web Driver’s architecture is simpler than Selenium RC’s.
|
Selenium RC is slower since it uses a JavaScript program
called Selenium Core.This Selenium Core is the one that directly controls the
browser, not you.
|
Web Driver is faster than Selenium RC since it speaks
directly to the browser uses the browser’s own engine to control it.
|
Selenium Core, just like other JavaScript codes, can
access disabled elements.
|
Web Driver interacts with page elements in a more realistic
way.
|
Selenium RC’s API is more matured but contains redundancies
and often confusing commands.
|
Web Driver’s API is simpler than Selenium RC’s. It does not
contain redundant and confusing commands.
|
Selenium RC cannot support the headless HtmlUnit
browser. It needs a real, visible browser to operate on.
|
Web Driver can support the headless HtmlUnit browser.
|
Selenium RC Has Built-In Test Result Generator. Selenium RC
automatically generates an HTML file of test results.
|
Web Driver has no built-in command that automatically
generates a Test Results File.
|
Selenium RC needs the help of the RC Server in order to do so.
|
web Driver directly talks to the browser
|
Selenium RC can support new browsers
|
It cannot readily support new browsers
|
5. Difference between Web driver listener and
TestNG Listener.
TestNG and Web driver Listener have different interfaces to
implement and call them. They both
modify respective behaviour. You can use Listeners in Annotation. Below 2 URL gives the
detailed list of listener and their interfaces.
modify respective behaviour. You can use Listeners in Annotation. Below 2 URL gives the
detailed list of listener and their interfaces.
http://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/support/events/
AbstractWebDriverEventListener.html
AbstractWebDriverEventListener.html
6. Describe your framework.
Refer automation link
7. Which is the best way to locate an
element?
Finding elements by ID is usually going to be the fastest
option, because at its root, it eventually calls down to
document.getElementById(), which is optimized by many browsers.
Finding elements by XPath is useful for finding elements using
very complex selectors, and is the most flexible selection strategy, but it has
the potential to be very slow, particularly in IE. In IE 6, 7, or 8, finding by
XPath can be an order of magnitude slower than doing the same in Firefox. IE
provides no native XPath-over-HTML solution, so the project must use a
JavaScript XPath implementation, and the JavaScript engine in legacy versions
of IE really is that much slower.
If you have a need to find an element using a complex selector,
I usually recommend using CSS Selectors, if possible. It's not quite as
flexible as XPath, but will cover many of the same cases, without exhibiting
the extreme performance penalty on IE that XPath can.
8. Why we refer Firefox driver to the web driver
inheritance.
web Driver driver = new FireFoxDriver();
WebDriver is an interface which contain several abstract methods
such as get(...), findElamentBy(...) etc.
We simply create reference of web Driver and we can assign
objects (Firefox driver, CromeDriver, IEDriver, Andriod driver etc) to it.
Ex :
WebDriver driver = new FireFoxDriver();-----------(1)
If we are using (1) we can do the same thing by using
FireFoxDriver driver = new FireFoxDriver();---------(2)
We can use (1) and (2) for same purpose but if we want to switch
to another browser in same program
then again we have to create the object of other class as for
example
CromeDriver driver = new CromeDriver();.
creating object of several class is not good. So we create the
reference of WebDriver and
we assign the objects of another class as for example
WebDriver driver; // it is created only one time in the program
driver = new FireFoxDriver();// any where in the program
driver = new CromeDriver(); // any where in the program
9. What are the features of TestNG?
TestNG is a testing framework designed to simplify a broad range
of testing needs, from
unit testing (testing a class in isolation of the others) to integration testing (testing entire
systems made of several classes, several packages and even several external frameworks,
such as application servers). You can use test suite,annotations, automatically generation
of report and much more.
unit testing (testing a class in isolation of the others) to integration testing (testing entire
systems made of several classes, several packages and even several external frameworks,
such as application servers). You can use test suite,annotations, automatically generation
of report and much more.
10. What is the difference between
thread.Sleep() and selenium. Set Speed ("2000")?
If the application is taking time to load the page then we use
selenium.waitforpageload(" "). This command is doesn’t wait upto the
given time whenever the page load is completed.
If the application is taking time to refresh the page, then we
use Thread. Sleep ( ).it is a standard wait it simply wait to the given time.
selenium.setSpeed
1. Takes a single argument in string format
Ex: selenium.setSpeed("2000") - will wait for 2
seconds
2. Runs each command in after setSpeed delay by the number
of milliseconds mentioned in set Speed.
thread.sleep
1. Takes a single argument in integer format
ex: thread. Sleep(2000) - will wait for 2 seconds
2. Waits for only once at the command given at sleep.Download Next 90 Selenium webdriver interview Questions and answers From
https://drive.google.com/file/d/0B6bhRbDoX68pX3VjLV9kYzV3am8/edit?usp=sharing
Very good collection of question and answers thank you for sharing. Know more about Selenium Testining Training
ReplyDeleteThis was actually what i was looking for,and i am glad to came here you keep up the fantastic work!my weblog.. I like the trend that content is becoming more and more important.
ReplyDeleteSelenium Training in Chennai
Awesome post, thanks for sharing all the important questions..
ReplyDeleteIt was very helpful for interview.
Selenium training in Chennai | Best Selenium training institute in Chennai
Please keep sharing such articles.
This comment has been removed by the author.
ReplyDeleteSelenium is Open Source - Functional Automation Tool, It supports most of the languages like Java, Perl, Python, Ruby, C#, PHP, Dot Net. It is also supports to all OS and all Browsers in the market. They are classified into four 1. Selenium IDE, 2.Selenium WebDriver, 3. Selenium RC (Remote Control), 4.Selenium Grid
ReplyDeleteNote: Current requirement in industry is Selenium WebDriver (Version 2.0)
Selenium Training in Chennai
Looking for best Software Testing Training in Chennai? CREDO SYSTEMZ is the No 1 Software Testing Training Institute in Chennai offering professional training on both Manual, automation testing training like Selenium, QTP/UFT and Performance Testing Training Courses like LoadRunner and JMeter. More Details: Software Testing Training course details.
ReplyDeleteGreat article on Software Functional testing automation using Selenium suite.
ReplyDeleteThanks so much.
Interview focussed Selenium Training in Chennai
Thanks for the post, It is very helpful. High appreciate the efforts for sharing all the in-details and browser configurations for testing Selenium Grid.
Check out one of the post related to selenium concepts
Hi,
ReplyDeleteThanks for sharing the great information about Selenium webdriver Its useful and helpful information…Keep Sharing.
Hi,
ReplyDeleteThanks for sharing the great information about Selenium Webdriver… Its useful and helpful information…Keep Sharing.
Thanks
Hari
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteYou can find more selenium webdriver interview questions here : Selenium Webdriver Questions for interview
ReplyDeleteThanks for Sharing this Valuable Information i like this i Can Share this with My Friend Circle.
ReplyDeleteSelenium Interview Questions and Answers
ReplyDeleteVery interesting Information on selenium. And I Enjoy This Episode Today. Thank You.
Selenium is most used automation tool to test web application and browser. This automation tool offers precise and complete information about a software application or environment.
ReplyDeleteSelenium Training in Chennai
This blog has very effective content about Big data thanks for sharing this type of information.
ReplyDeleteHadoop big data classes in pune
Big Data Training in Pune
Big data hadoop training in pune
Good Post. I like your blog. Thanks for Sharing.....
ReplyDeleteSelenium course in Noida
nice course. thanks for sharing this post this post harried me a lot.
ReplyDeleteSelenium Training in Noida
very interesting and useful informationSelenium training in chennai | Selenium training in velachery
ReplyDeleteContent on your blog is really informative 50 High Quality for just 50 INR
ReplyDelete2000 Backlink at cheapest
5000 Backlink at cheapest
Boost DA upto 15+ at cheapest
Boost DA upto 25+ at cheapest
Boost DA upto 35+ at cheapest
Boost DA upto 45+ at cheapest
Smm panel
ReplyDeletesmm panel
İs İlanlari
İnstagram Takipçi Satın Al
Hirdavatciburada.com
beyazesyateknikservisi.com.tr
servis
tiktok jeton hilesi
Draw list perform card feel candidate live risk. Remain art actually expect.breaking news in india today
ReplyDelete