Selenium Interview Question-2
24) Explain what is the difference between find elements ()
and find element () ?
find element ():
It finds the first element within the current page using the
given “locating mechanism”. It returns a single WebElement
findElements () : Using the given “locating mechanism” find all
the elements within the current page. It returns a list of web elements.
25) Explain what are the JUnits annotation linked with
Selenium?
The JUnits annotation linked with Selenium are
·
@Before public void method() – It will perform the method ()
before each test, this method can prepare the test
·
@Test public void method() – Annotations @Test identifies that
this method is a test method environment
·
@After public void method()- To execute a method before this
annotation is used, test method must start with test@Before
26) Explain what is Datadriven framework and Keyword
driven?
Datadriven framework: In this framework,
the test data is separated and kept outside the Test Scripts, while test case
logic resides in Test Scripts. Test data is read from the external files
( Excel Files) and are loaded into the variables inside the Test Script.
Variables are used for both for input values and for verification values.
Keyworddriven framework: The keyword driven
frameworks requires the development of data tables and keywords, independent of
the test automation. In a keyword driven test, the functionality of the
application under test is documented in a table as well as step by step
instructions for each test.
27) Explain how you can login into any site if it’s showing
any authentication popup for password and username?
Pass the username and password with url
·
Syntax-http://username:password@url
·
ex- http://creyate:tom@www.gmail.com
28) Explain how to assert text of webpage using selenium
2.0 ?
WebElement el = driver.findElement(By.id(“ElementID”))
//get test from element and stored in text variable
String text = el.getText();
//assert text from expected
Assert.assertEquals(“Element Text”, text);
29) Explain what is the difference between Borland Silk and
Selenium?
Silk
Test Tool
|
Selenium Test Tool
|
·
Borland Silk test is not a free testing tool
|
·
Selenium is completely free test automation
tool
|
·
Silk test supports only Internet Explorer
and Firefox
|
·
Selenium supports many browsers like
Internet Explorer, Firefox, Safari, Opera and so on
|
·
Silk test uses test scripting language
|
·
Selenium suite has the flexibility to use
many languages like Java, Ruby,Perl and so on
|
·
Silk test can be used for client server
applications
|
·
Selenium can be used for only web
application
|
30) What is Object Repository ?
An object repository is an essential entity in any UI
automations which allows a tester to store all object that will be used in the
scripts in one or more centralized locations rather than scattered all over the
test scripts.
31) Explain how Selenium Grid works?
Selenium Grid sent
the tests to the hub. These tests are redirected to Selenium Webdriver, which
launch the browser and run the test. With entire test suite, it allows
for running tests in parallel.
32) Can we use Selenium grid for performance testing?
Yes. But not as effectively as a dedicated performance testing
tool like Loadrunner.
33) List the advantages of Webdriver over Selenium
Server?
·
If you are using Selenium-WebDriver, you don’t need the Selenium
Server as it is using totally different technology
·
Selenium Server provides Selenium RC functionality which is used
for Selenium 1.0 backwards compatibility
·
Selenium Web driver makes direct calls to browser using each
browsers native support for automation, while Selenium RC requires selenium
server to inject Javascript into the browser
34) Mention what are the capabilities of Selenium
WebDriver or Selenium 2.0 ?
WebDriver should be used when requiring improvement support for
·
Handling multiple frames, pop ups , multiple browser windows and
alerts
·
Page navigation and drag & drop
·
Ajax based UI elements
Multi browser testing including improved functionality for browser not
well supported by Selenium 1.0
Thanks for Sharing, Great
ReplyDeletePython Online Training