Sunday, March 31, 2013

Selenium RC Quiz Part 3


Selenium is a popular open source test automation tool for web applications that is used for functional and cross-browser compatibility testing. You may have already attempted the Selenium Quiz Part 1 and 2. If not, try those first. Now, attempt the part 3 of this quiz to check your familiarity with Selenium RC (also known as Selenium 1). Selenium RC is the original Selenium tool. RC has the Selenium Server that controls the browsers and Client Libraries for the supported programming languages (Java, Ruby, Python, Perl, PHP or .Net). Each question in this quiz has four options with one best answer. The score appears at the bottom left. A score of 5 or less indicates low knowledge; 6 to 7 means a fair level of knowledge and 8 and above shows a good knowledge of Selenium RC.
Instead of this quiz, you may want to see my video on Selenium Questions and Answers where I have compiled all these questions.

1. What are the different modes that Selenium uses?
*iehta
*firefox and *iexplore
*chrome
All of the above

2. How do you start the browser?
selenium.Start()
get start()
selenium.server start()
None of the above

3. Do you need to have Selenium .jar files as a dependency of your tests?
Yes
No
Yes, but as a good practice only
No Selenium jar file is provided with Selenium RC.

4. How many parameters does the Selenium object take when using DefaultSelenium?
2
3
4
6

5. How do you start selenium rc server with user extensions?
java -jar selenium-server.jar
java -jar selenium-server.jar -userExtensions user-extensions.js
java -jar selenium-server.jar user-extensions.js
java -jar selenium-server.jar user-extensions.js -h

6. Which Selenium command do you use to run commands in slow motion in Selenium RC?
selenium.setSpeed()
selenium.speed()
selenium.serverSpeed()
None of the above

7. Which command is used to get the alert box?
assertequals(selenium.getAlert())
selenium.getAlert()
selenium.alertBox()
selenium.click()

8. Which command is used for verifying if a web element exists?
selenium.isElementPresent(String locator)
assertTrue(Selenium.isElementPresent())
selenium.ElementPresent()
None of the above

9. Which command is used for typing in a textbox?
selenium.input()
selenium.type(String locator, String value)
assertequals(selenium.getValues())
selenium.textInput()

10. What is the command to load a page?
selenium.waitForPageToLoad(String timeoutInMilliseconds)
selenium.waitForPageToLoadInt timeoutInMilliseconds
selenium.waitForPageToLoad(timeoutInMilliseconds)
selenium.waitForPageToLoad()
Score is 0/ 10.

I have written the JavaScript source code that runs the quiz. The questions and answers of this quiz have been contributed by Varsha Tomar.

Please remember to mention your scores in the comments below. Now answer the quiz on Selenium WebDriver (also known as Selenium 2).