date:2018526 Day10
I. Import library
There are two types of imported libraries, one is to import common libraries, such as String, collections, etc. (Library string, collections, and then use the keywords in the library), and the other is to import the written. py file, which is also required the library. py file, Then use the keywords
two. Web Automation Fundamentals
1.selenium2library
Selenium2library is essentially the encapsulation of a series of keywords (methods) that are provided to the ride in an interface and provided to automated test calls.
Installation action:
Place the Chromedriver.exe under Python27 and run "Pip install Robotframework-selenium2library" in CMD before the library in the Suite (suite) can be completed Selenium2library
Basic use (Press F5 key shortcut search Keywords):
Click element keyword: Call this keyword to pass a parameter locator positioning
Input text keyword: This keyword needs to pass two parameters locator positioning, text input content
Select from List by value keyword: (this keyword selects an option by using the Value property in the drop-down box)
Select window Keyword: (this keyword can be selected by Url/title)
2. jquery of positioning methods
First in Chrome press F12 to open debugging, get element ID, class, etc., in the console debugging (ctrl+l= Elimination of debugging in the console), if you can successfully tune the element, you can write ride
To locate an element by ID:
To position elements through class:
There are seven conforming elements, and we need the elements in the first, so you can use EQ () to select
Note: When multiple anchor elements are found, the XPath is calculated from 1, and jquery starts with 0.
To position an element with text:
3. XPath of the positioning method ( except for text, all lookup attribute values must be @)
To locate an element by ID:
To position elements through class:
To position an element with text:
Automation (robotframework) Fundamentals · Web-side