Thursday, 17 December 2015

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

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.

Which attribute you should consider throughout the script in frame for “if no frame Id as well as no frame name”?

You can use…..driver.findElements(By.xpath(“//iframe”))….
 This will return list of frames.
 You will ned to switch to each and every frame and search for locator which we want.
 Then break the loop

Mention what is the difference between Implicit wait and Explicit wait?

Implicit Wait: Sets a timeout for all successive Web Element searches. For the specified amount of time it will try looking for element again and again before throwing a NoSuchElementException. It waits for elements to show up.
 Explicit Wait : It is a one-timer, used for a particular search.

What are the features of TestNG and list some of the functionality in TestNG which makes it more effective?

TestNG is a testing framework based on JUnit and NUnit to simplify a broad range of testing needs, from unit testing to integration testing. And the functionality which makes it efficient testing framework are
 Support for annotations
Support for data-driven testing
Flexible test configuration
Ability to re-execute failed test cases

How you can use “submit” a form using Selenium ?

You can use “submit” method on element to submit form-
 element.submit () ;
 Alternatively you can use click method on the element which does form submission

What is heightened privileges browsers?

The purpose of heightened privileges is similar to Proxy Injection, allows websites to do something that are not commonly permitted. The key difference is that the browsers are launced in a special mode called heightened privileges. By using these browser mode, Selenium core can open the AUT directly and also read/write its content without passing the whole AUT through the Selenium RC server.