Selenium 課程考卷..

Selenium 課程考卷..

測試自己對於 Web Automation Selenium 的了解

 

Q1: To automate or not to automate, what will be your key considerations? List 3 key points.
 

 

 

 

Q2: In selenium IDE, what commands you can use for the following scenario?
  • clicking a link – ___________________

 

  • entering values – _________________

 

  • selecting options from a drop-down listbox – ___________

 

  • clicking checkboxes or radio buttons – ___________

 

  • Click ok or cancel for an alert –  _________________

 

Refer to the Selenese command list here.

http://release.seleniumhq.org/selenium-core/1.0.1/reference.html

Q3: Visit the website: http://travelingtony.weebly.com/

How to click the “South Africa”?

 

Reference

  • xpath=//img[@alt=’The image alt text’]
  • xpath=//table[@id=’table1′]//tr[4]/td[2]
  • xpath=//a[contains(@href,’#id1′)]
  • xpath=//a[contains(@href,’#id1′)]/@class
  • xpath=(//table[@class=’stylee’])//th[text()=’theHeaderText’]/../td
  • xpath=//input[@name=’name2′ and @value=’yes’]
  • xpath=//*[text()=”right”]
Q4: For AJAX behaviors,

Visit the website, http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_first

Click “change Content”. how can you verify the dynamic show-up message?

 

Hint: The following commands are what you will need in this case.

 

 

 

Command Target Value
     
     
     
     
Q5: To locate a web element, what’s the pro/con for the uses of CSS and Xpath?
 

 

 

 

 

 

 

 

 

Q6: What will be the recommended order of web element locator? what needs to take into consideration when use one of locator?
 

Locate by Name:_________________

 

Locate by ID, _____________________

 

Locate by Xpath ______________

 

Locating Hyperlinks by Link Text ________________________

 

Locate by CSS __________________

Q7: “waitForElementPresent ” is very useful to handle dynamic webpage such as AJAX. Why and when we will use “clickAndWait”?
 

 

 

 

Q8:  Go to Forefox Addon market to download and install ” Selenium IDE: Implicit Wait”

This plugin allows Selenium IDE to automatically wait until all the required elements are present before executing the next command.

Let’s rewrite Q4 testing scripts. Remove “waitForElementPresent”  Add ” setImplicitWait” “5000”.

 

What’s your findings here?

 

 

 

Q9: What is required to launch the Selenium IDE from command line?
 

 

 

 

Q10: What are the limitations if we use FireFox selenium IDE to launch IE or Chrome browser for testing?
 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *