First, environmental needs
2, installation 3.6python: 3.6python download the installation package Baidu Cloud extract password: ynln
pycharm installation package, finished package, jdk installation package password: ylt5
3, installation robot framwork
(1) corresponding to the robot framwork python3.6 download installation package: 32-bit and 64-bit Baidu cloud extracting Password: l8j2
(2) mounting step: the cmd command window
Step 1: Install Framework Robot
PIP install robot framework
Step two:
install wxPython 2.8.12.1 (xx.whl represent whl installation package store path plus the installation package name, for example, I was put wxPython-4.0.0b2-cp36-cp36m- win_amd64 .whl python on the Scripts directory under the installation path: E: \ install \ python.install \ Scripts
Then you can enter: PIP install E: \ install \ python.install \ Scripts \ wxPython-4.0.0b2-CP36-cp36m-win_amd64.whl )
PIP install xx.whl
third step:
robot framework-Ride:
PIP install robot framework-Ride
fourth step:
install selenium library
pip install robotframework-selenium2library
Step Five: View the installed package
Note: The python 32 mounted on the rf 32, 64 of the python on the installation rf 64! And this robot framwork installation package corresponding to python.6 version!
Second, the use of automation theory and rf
1, what is automated
automated testing: program testing program (write test scripts to simulate the human execute test cases)
2, automation meaning
1) software testing cycle can be shortened, so that products to market faster and
2) increase test the stability and reliability
3) increase trust software
4) automate more convenient
3, the principle of automation
1) selection of stable item
2) select the stable version
3) select the key business
4, assess the workload of
1) try detailed list of possible test content
2) to test the task down to each function point
3) to assess the workload based on the experience accumulated
5, automation use cases reviewed (write functional test cases)
1) review the use case whether automation
2) whether the demolition of use cases divided, merged
3) automation priority use cases
5, team building
1) test development
2) senior test engineer (5 test modules a day)
3) Intermediate test engineer (3-4 module test day)
4) primary test engineer (1-2 module test day)
6, positioning elements: look for elements on the page process (way)
1) positioning method:
(1) Location ID (id if the input box positioned on Baidu)
open browser | http://www.baidu.com | chrome |
Maximize Browser Window | ||
sleep | 2 | |
input text | id=kw | UI test automation |
click element | id = are | |
sleep | 5 |
(2) Name Location (if name input box positioned on Baidu)
open browser | http://www.baidu.com | chrome |
Maximize Browser Window | ||
sleep | 2 | |
input text | name=wd | The best of us |
click element | id = are | |
sleep | 5 |
(3) Class Location: When the composite class to open, one to test
open browser | http://www.baidu.com | chrome |
Maximize Browser Window | ||
sleep | 2 | |
input text | class=s_ipt | The best of us |
click element | class=s_btn | |
sleep | 5 |
(4) Link Location
open browser | http://www.baidu.com | chrome |
Maximize Browser Window | ||
sleep | 2 | |
click element | link = News | |
sleep | 5 |
(5) Partial Link Location
(6) Tag Location
open browser | http://www.baidu.com | chrome |
Maximize Browser Window | ||
{@} Input_els | get webelements | tag=input |
input text | Input_els {@} [7] | tag positioning |
click element | id = are | |
sleep | 3 |
(7) CSS Location: (CSS: find a position corresponding -> right click -> Copy-> Copy selector; Optimization: tag [Properties] The input [name = "xxx"] )
open browser | http://www.baidu.com | chrome |
Maximize Browser Window | ||
sleep | 2 | |
input text | css=input[name="kw"] | The best of us |
click element | css=input[name="su"] | |
sleep | 5 |
(8) Xpath positioning (xpath: find location to get status -> right click -> Copy-> Xpath)
open browser | http://www.baidu.com | chrome |
Maximize Browser Window | ||
sleep | 2 | |
input text | xpath=//*[@id="kw"] | The best of us |
click element | xpath=//*[@id="su"] | |
sleep | 5 |
7, the concept of element
1) element recognizer
2) Elemental
3) Property
4) Label