• 关于 locust at 2017年02月18日

    2 楼正解,这种情况 locust 官网有说到的。我之前也遇到过,将 script 文件路径放到环境变量里就 ok 了。

  • #17 楼 @luke 我觉得是类似的情况。

  • #13 楼 @zrleo 我这边也是在测试微信号里测试的,你可以实现整个过程自动化的,从手机自动解锁,自动启动微信程序,自动点点点进入到测试网页。人工是怎么进入目标页面的,就驱动手机做相应操作。不是很清楚配置微信菜单是什么情况,建议你发个新帖问问其他朋友。

  • #11 楼 @zrleo 看了你的 log,说了当前的 context 没有 webview 哦。建议你先搜索一下什么时候才需要转 context。如果你一进入微信,想要控制元素进入公众号之类的,在 native context 下就可以控制元素了。不需要转 context,公众号里面打开网页,这时要转 context。

  • #8 楼 @utopia 不是小程序,是公众号里面的网页。

  • #6 楼 @utopia 转换 webview 后,我是能操作元素的。建议你再检查一下元素的定位信息。

  • 我跟楼主遇到一样的问题,后来设置一下配置信息解决了。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\":\"测试平台\"}"