Aritest + python implementation of the client UI Automation

Preliminary test the water, write python script, the script has been automated stand-alone case, currently hinder "not dual FBI, to verify communication."
Outside of work practice two months, the problems encountered with the Notes down for easy access.
Previous:
Airtest: The main element is used to obtain information on the page, and in Airtest in tune script is also possible, but not up to standard.
Pycharm: a tool used to write the script, relatively easy
 
Process:
First, install AirTest:
      Download the version number: AirtestIDE_2018-10-11_py3_Mac10-12.dmg 
2, account number: GitHub account / password: XXXXX / XXXX (own registered test account)
3, direct download adb tool kit to establish the connection: platform-tools_r29.0.1-darwin.zip
 
Two, Airtest to establish a connection with the android phone:
1, even on Android phones
2, the terminal determines whether the connection can be established adb devices
3, opening the target APP, get the front page is the page elements
4, touch the test water Airtest () function
5, simple demo
 
Third, the first demo of the problems encountered:
1, how to establish contact with your phone (Android)
adb devices
Open the developer permission
 
2, obtaining app package name: https://www.cnblogs.com/dzblog/p/4062288.html
adb shell pm list packsge
 
3, rendering the tree can not get out?
Select the Android poco mode, or reboot AirtestIDE 
 
4、AirtestIDE提示Connection reset by peer?
Because the two libraries Unity and Android introduced, a library will be identified as the final
 
5, how to execute a python script airtest written on Android phones that link?
Into the current script directory: directory under python3 Andrews airtest, need to go to the next file:
cd /Library/Frameworks/Python.framework/Versions/3.7/bin
Not directly
cd  /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
 
6, implemented on a slide
poco.swipe([0.5,0.9],[0.5,0.2],duration = 0.2) 
 
7. Click the blank: poco.click ([0.5,0.5])
 
8, have replaced the time.sleep (2), each running the same case, the results are not the same? Frequently interrupted case, suggesting: orientationWatcher has ended
Scripts should be no problem, the same script, the same cell phone, use airtest command on the windows is no problem.
After investigation, we found that as long as the initialization poco will trigger this problem, do not use poco, commands can be completed normally.
 
Four, PyCharm use encountered problems
1, finished PyCharm editor.
In Mac- application - displays the contents of the package - Alternatively lib / resources_zh_CN_PyCharm_2018.3_r1.jar 
 
2, the new file name is red, green meanings:
 
Gray: the file is already synchronized
Red: is present but not synchronized to a local file repository. When added to the repository, the file name green
Blue: a file has changed and not synchronized to the warehouse.
 
3, pycharm import code, solve the python version does not correspond to the relationship
To resolve reference links: https://www.jianshu.com/p/a7aefc40d4d7
 
4, solve pycharm does not support airtest code?
pycharm add third-party packages, mainly airtest, pocoui
 
5, pycharm shortcuts
Tightening and backward (left)
Code Select: Press the Tab key
shift+Tab 
 

Guess you like

Origin www.cnblogs.com/darlingmz/p/11387792.html