2 楼正解,这种情况 locust 官网有说到的。我之前也遇到过,将 script 文件路径放到环境变量里就 ok 了。
我跟楼主遇到一样的问题,后来设置一下配置信息解决了。https://testerhome.com/topics/7097
#1 楼 @Tester957 你可以试试我下面的方法,希望可以帮到你。
亲测可用方法:
在配置信息里加上这段(我的是 JavaScript Client)
chromeOptions: {
androidProcess:"com.tencent.mm:tools"
}
具体的也可以参考此贴
https://testerhome.com/topics/6954(里面有说到原因)
post 一下成功后的 log
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/hub/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Window
s NT\",\"version\":\"10.0.14393\"}}}"
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.tencent.
mm","androidUseRunningApp":true,"androidProcess":"com.tencent.mm:tools","androidDeviceSerial":"0123456789ABCDEF"}}}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"a3501a8a437dc4d9ec2700de1bcc95d3","status":0,"value":{"acceptSslCerts":true,"applicationCacheEnabled":false,"b
rowserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed)"},"cssSelectorsEnabled":true,"datab
aseEnabled":false,"handlesAlerts":true,"hasTouchScreen":false,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"pageLoad
Strategy":"normal","platform":"ANDROID","rotatable":false,"takesHeapSnapshot":true,"takesScreenshot":true,"version":"37.0.0.0","webStorageEnabled":true}}
[debug] [Chromedriver] Changed state to 'online'
[debug] [MJSONWP] Responding to client with driver.setContext() result: null
[HTTP] <-- POST /wd/hub/session/0a5c638f-1489-4cb4-b5ae-435235699860/context 200 6266 ms - 76
[HTTP] --> GET /wd/hub/session/0a5c638f-1489-4cb4-b5ae-435235699860/title {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/0a5c638f-1489-4cb4-b5ae-435235699860/title] to [GET http://127.0.0.1:8000/wd/hub/session/a3501a8a437dc4d9ec2700de1bcc95d3/ti
tle] with body: {}
[debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"a3501a8a437dc4d9ec2700de1bcc95d3\",\"status\":0,\"value\":\"测试平台\"}"