問題:appium默認啟動一個應用的session過期時間是60秒到時間會自動停了剛啟動的應用,工作臺打印:info: [debug] We shut down because no new commands came in的日志
? ?
分析:--command-timeout ?60?The default command timeout for the server to use for all sessions (in seconds and should be less than 2147483). Will still be overridden by newCommandTimeout cap
意思是默認60秒過期,超過60秒就會自動
解決辦法:
從appium工作臺最前面找到,啟動命令:
> Launching Appium server with command: C:\Program Files (x86)\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --avd Nexus7 --platform-name Android --platform-version 19 --automation-name Appium --device-name "Android Emulator" --log-no-color
在cmd命令行,對應目錄加時間參數即可:--command-timeout 600
在目錄:C:\Program Files (x86)\Appium>
執行
node.exe node_modules\appium\lib\server\main.js --
address 127.0.0.1 --port 4723 --avd Android4.4.2 --device-ready-timeout 70 --pla
tform-name Android --platform-version 19 --automation-name Appium --avd Nexus7 -
-device-name "Android Emulator" --log-no-color --command-timeout 600
啟動日志中就能看到:
info: [debug] Non-default server args: {"address":"127.0.0.1","logNoColors":true
,"avd":"Nexus7","androidDeviceReadyTimeout":"70","deviceName":"Android Emulator"
,"platformName":"Android","platformVersion":"19","automationName":"Appium","defa
ultCommandTimeout":600}
時間變成600秒了
【整整200集】超超超詳細的Python接口自動化測試進階教程合集,真實模擬企業項目實戰