I. Introduction of Selenium
Selenium is an acceptance testing tool ThoughtWorks specifically written for WEB applications.
The biggest benefit of using Selenium compared to other test tools is that the Selenium test runs directly in the browser, just as the real user does.
Selenium tests can be run in Windows, Internet Explorer on Linux, Mozilla, and Firefox. None of the other test tools can cover so many platforms.
Rfs=robot Framework + Selenium
Second, the environment construction
1. Install Python, we recommend using ActivePython-2.7
2. Installing wxPython2.8
3.pip Install Robotframework
4.pip Install Robotframework-ride
5.pip Install Robotframework-selenium2library
Browser driver:
Http://code.google.com/p/selenium/downloads/list
Third, Firebug installation
Iv. Basic use of RFS
1. Element positioning
Notes on ① positioning:
Sometimes, you need to go into a frame or an iframe and then position an element so that it is more efficient to use the following two keywords.
Enter a frame or IFRAME
Select Frame | Locator
Back to top frame or iframe
Unselect Frame
Expert in ② positioning: Xpath
XPath is a language that looks for information in an XML document. XPath is used to navigate through elements and attributes in an XML document.
XPath is an XML Path language used to query nodes in an XML document. Xpath is supported by mainstream browsers. The Xpath language is a tree structure based on an XML document and provides the ability to browse the tree and select nodes through a variety of criteria.
http://www.w3school.com.cn/xpath/
Locating elements with absolute paths
Xpath=/html/body/form/input
Locating elements by relative paths
Xpath=//input
Using indexes to locate elements
XPATH=//INPUT[2]
Locating elements using attribute values
xpath=//input[@id = ' username ')
xpath=//input[@id = ' username ' [@name = ' username ']
xpath=//input[@id = ' username ' and @name = ' username ')
xpath=//input[@id = ' username ' or @name = ' username ')
Using attribute names as elements
xpath=//input[@name]
Locating elements using Partial attribute values
Use values to match any attributes and elements
input[@*= ' username ']
Web Automation Foundation Sharing