General boot Appium Service method:Open cmd, Run command: #>appium-a 127.0.0.1-p 4723 When the program outputs such as information, indicating that the Appium started successfully, it can be run at this time
TestThe script. Write UI Automation using the Appium framework
Test Cases, always need to start appium service, it is too troublesome, so I added a self-initiated Appium service in the project small function, share with you, do not like to spray.
1. Create bat file Startappiumserver.bat@echo off
Title Startappiumservercmd/c "appium-a 127.0.0.1-p 4723"
2. Create bat file Stopappiumserver.bat@echo off
Title stopappiumserver
Tasklist /v|find if %errorlevel%==0 (
::appium "Windowtitle eq startappiumserver"
) taskkill/f/fi "windowtitle eq stopappiumserver"
3, put Startappiumserver.bat and Stopappiumserver.bat in the project catalogAdd the following code before you begin executing the test case code: Os.system (' Start Startappiumserver.bat ') # Start appium service Time.sleep (8) # wait for appium service to start After executing the test case code, add the following code: Os.system (' Start Stopappiumserver.bat ') # Close appium service
Self-booting Appium service in Python program