Saturday, December 27, 2014

Selenium WebDriver Quiz Part 4

Selenium is a popular open source test automation tool for web applications that is used for functional and cross-browser compatibility testing. You can learn from my video, Selenium WebDriver tutorial.

You may have already attempted the Selenium Quiz Parts 1, 2 and 3. If not, try those first. Now, attempt this short part 4 of this quiz to check your familiarity with Selenium WebDriver (also known as Selenium 2) basics. Selenium-WebDriver is the new Selenium tool that has a simpler and more powerful API than Selenium 1. Additionally, it addresses the limitations of Selenium RC. Each question in this quiz has four options with one best answer. The score is updated at the bottom left as you answer each question.

1. Which of these WebDriver interface methods is used to open a URL in the browser?
Any of the above
None of the above

2. What is the difference between WebDriver close and quit methods?
Nothing, these methods are interchangeable.
close method clears the browser memory and the quit method closes the browser window.
close method closes the browser but the quit method additionally removes the connection to the server.
close method closes the main browser window but the quit method closes all the browser windows including popups.

3. When invoked on a web element, what does the submit method do?
It is used to submit a form and it works on any web element.
It is used to submit a form but it works only on the web element whose type is "submit".
It is the same as the click method.
There is no submit method for a web element.

4. Which WebDriver method is used to change focus to an alert, a web element or a browser window?

5. What functionality does WebDriver support on browser cookies?
add and delete an individual cookie
delete all cookies
any of the above
none of the above

6. What is the scope of an implicit wait?
All instances of WebDriver
Current WebDriver instance
Current expected condition
Current web element
Score is 0/ 6.
Please remember to mention your scores in the comments below.