• 这个问题多半处在 wda 上面,分析过程
    手工运行 wda,看能否把 wda 安装到测试设备并启动被测试 App
    如果 wda 安装失败,检查:
    a. ideviceinstaller 工具单独能否正常安装卸载 app
    b. wda 签名是否设置正确

  • TesterHome 上海 12月 份沙龙 at 2017年12月19日

    已经报名还是要和大牛多学习

  • 我觉得没必要这么详细,你给了他这条命令,他还会问你怎么安装工具,你指导他安装好了,他还会问你,工具安装完了怎么使用,

    我觉得搞技术的人,有方向和思路就够了

  • ideviceinstaller
    ios-deploy

  • 我不是大佬,我三周之前才开始使用 appium, 但是你这个错误信息已经很明确:就是你的设备信息填写错误

    Original error: Could not create simulator with name 'appiumTest-48dc374e-89b8-4660-a250-2c2372409fff', device type id 'iphone 6s' and runtime id '11.0.1'. Reason: 'simctl error running 'create': Invalid device type: iphone 6s ios
    

    这段说的很明确了
    怎么检查目前能够使用的设备: instruments -s devices;, 第一列:设备名字, 第二列: 操作系统版本, 第三列: udid

    instruments -s devices;
    Known Devices:
    的iMac (4) [970D94F2-3ED8-512F-85B8-C66E7EB30986]
    Apple TV (11.0) [03E31959-A7A4-4AD3-AF20-BEDB8900355B] (Simulator)
    Apple TV 4K (11.0) [74D6125E-C8CC-4A61-84DA-18D3C55C2C2C] (Simulator)
    Apple TV 4K (at 1080p) (11.0) [C2CC802D-26AA-4B6C-A71B-3B0C3E4E69ED] (Simulator)
    Apple Watch - 38mm (4.0) [EBA95B0B-739E-47AE-B6B6-DEC4EE1DC807] (Simulator)
    Apple Watch - 42mm (4.0) [235548EB-1DA9-4960-9602-D8F6537BA0BB] (Simulator)
    iPad (5th generation) (11.0.1) [C86E2A78-044E-49D0-B23D-92A0ABBA91E5] (Simulator)
    iPad Air (11.0.1) [8A6D8435-D548-4BBE-A436-250ECA87100F] (Simulator)
    iPad Air 2 (11.0.1) [95E75941-6CF1-41C2-8EB2-EA06C5CDCBC0] (Simulator)
    iPad Pro (10.5-inch) (11.0.1) [586B0DD8-BF51-4B31-B6B0-A4AA460D8780] (Simulator)
    iPad Pro (12.9-inch) (11.0.1) [A6B7F67B-7852-438B-97C4-93107E63F38F] (Simulator)
    iPad Pro (12.9-inch) (2nd generation) (11.0.1) [DA511AE2-BFD7-4E27-A6BA-6ED35401F09D] (Simulator)
    iPad Pro (9.7-inch) (11.0.1) [DB5E083B-4849-4BA1-A6F3-307992BB722C] (Simulator)
    iPhone 5s (11.0.1) [2AC7BF6C-A15A-463F-AF15-F32FF34025F2] (Simulator)
    iPhone 6 (11.0.1) [7ED53934-94C7-4A9A-A86D-FC94A5868B4F] (Simulator)
    iPhone 6 Plus (11.0.1) [24C5C48D-C043-4AAF-B701-91C90AC37791] (Simulator)
    iPhone 6s (11.0.1) [717AD0D6-9E3C-4097-9474-DB395B95CDD6] (Simulator)
    iPhone 6s Plus (11.0.1) [888EBA98-A7A8-4FD8-AC71-8EDC7EF7D763] (Simulator)
    iPhone 7 (11.0.1) [D8539F0E-A744-45D7-AE45-9F56783434B0] (Simulator)
    iPhone 7 (11.0.1) + Apple Watch Series 2 - 38mm (4.0) [A1BCAD41-2521-4317-ADE7-1DB129398008] (Simulator)
    iPhone 7 Plus (11.0.1) [A56AE1AA-29A4-4F2F-ACF6-7E729AD66432] (Simulator)
    iPhone 7 Plus (11.0.1) + Apple Watch Series 2 - 42mm (4.0) [F08ABE15-104C-495F-85B9-8889F08AA0FD] (Simulator)
    iPhone 8 (11.0.1) [6EF7D949-B384-4559-90F8-84CA41229192] (Simulator)
    iPhone 8 (11.0.1) + Apple Watch Series 3 - 38mm (4.0) [8E304CAC-3ABB-45B2-A631-225701FA76CD] (Simulator)
    iPhone 8 Plus (11.0.1) [645E7E5D-3E2F-4324-8033-F2BC3427529A] (Simulator)
    iPhone 8 Plus (11.0.1) + Apple Watch Series 3 - 42mm (4.0) [533CBC3C-B313-4A82-ACBE-9D681160BD90] (Simulator)
    iPhone SE (11.0.1) [3D460F16-EBD6-483A-8B0D-8AAC539E6DF6] (Simulator)
    iPhone X (11.0.1) [81317C27-FC9E-4E96-A975-5B20FE6385FB] (Simulator)
    
  • 本着分享的原则,告诉大家可以这么下载
    CHROMEDRIVER_CDNURL=https://npm.taobao.org/mirrors/chromedriver npm i appium -g

    还有 nrm 的作用

    nrm ls
    
      npm ---- https://registry.npmjs.org/
      cnpm --- http://r.cnpmjs.org/
    * taobao - https://registry.npm.taobao.org/
      nj ----- https://registry.nodejitsu.com/
      rednpm - http://registry.mirror.cqupt.edu.cn/
      npmMirror  https://skimdb.npmjs.com/registry/
      edunpm - http://registry.enpmjs.org/
    

    多个源可以互相切换

  • 我说三点:

    1. npm 装包的时候不要随意加 sudo 权限,包之间互相调用会因为权限不同而失败
    2. 你这个问题 log 里面说了 timeout,所以首先检查 timeout
    3. 推荐 nrm 包管理源,nrm + npm 真好用
  • capabilities.setCapability("xcodeConfigFile", "/usr/local/lib/xcode.xcconfig");
    //capabilities.setCapability("autoAcceptAlerts",true);
    capabilities.setCapability("deviceName", "iPhone");
    capabilities.setCapability(MobileCapabilityType.UDID,ConfigProperty.get("serial"));
    capabilities.setCapability("automationName", "XCUITest"); //字段必不可少哦
    capabilities.setCapability("platformName", "iOS");
    capabilities.setCapability("platformVersion", ConfigProperty.get("platformVersion")); //字段必不可少
    capabilities.setCapability("bundleId", ConfigProperty.get("package")); //字段必不可少
    //capabilities.setCapability("locationServicesAuthorized", true);
    //capabilities.setCapability("appiumVersion", "1.7.1");


    检查 deviceName 和 platformVersion 这两个字段值设置的是否正确
    deviceName - iOS 设备名字
    platformVersion - iOS 设备的操作系统版本
    另外,推荐使用 libimobiledevice 工具

  • 这条命令,分两种情况:

    1. app 没有运行,启动 app 到首页
    2. app 在后台运行的话,会把 app 恢复到前台,但是不会恢复到 app 的首页
  • 请问具体操作或者命令有吗?不好意思我每次测试之前生成并启动 driver 页不生效

  • 这样我有信心了,我还是打算从 wda 开始,随机发送 monkey 测试流

  • 初步看来我还是应该多调研

  • 那可不可以指点思路,你怎么做的呀,先谢谢啦

  • 大神!!!!!!!!!!激动中,求更多信息, 非常感谢

  • webview 首屏时间如何计算 at 2017年05月17日

    非常感谢两位大牛,我之前一直用的是 H5 Resource Timing 开发到一半之后发现,跨域的资源信息是拿不到的,感谢感谢

  • 改了之后也没有效果,console 的 log 是:

    Response content:{"sessionId":"c4a27253-9a40-40d9-9479-bdc800668cea","status":6,"value":{"message":"no such session\n  (Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)"}}
    
  • 我也测试过你们提供的 macacatestsample 工程,同样不通过,log 是

    >> chromedriver starting success.
    >> proxy.js:52:14 [master] pid:24637 Proxy: /status:GET to http://localhost:9515/wd/hub/status:GET with body: 
    >> proxy.js:58:16 [master] pid:24637 Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Mac OS X\",\"version\":\"10.11.6\"}}}"
    >> proxy.js:52:14 [master] pid:24637 Proxy: /session:POST to http://localhost:9515/wd/hub/session:POST with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.github.android_app_bootstrap","androidUseRunningApp":true,"androidDeviceSerial":"P4M7N15411033070"}}}
    >> proxy.js:58:16 [master] pid:24637 Got response with status 200: {"sessionId":"2ef58ea8864a96aab301989f223c5513","status":0,"value":{"acceptSslCerts":true,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{},"cssSel...
    >> chromedriver ready with: {"sessionId":null,"status":0,"value":{"acceptSslCerts":true,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{},"cssSelectorsEnabled":true,"databaseEnabled":false,"handlesAlerts":true,"hasTouchScreen":false,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"platform":"ANDROID","rotatable":false,"takesHeapSnapshot":true,"takesScreenshot":true,"version":"30.0.0.0","webStorageEnabled":true}}
    >> proxy.js:52:14 [master] pid:24637 Proxy: /wd/hub/session/temp/window_handles:GET to http://localhost:9515/wd/hub/session/2ef58ea8864a96aab301989f223c5513/window_handles:GET with body: {}
    >> proxy.js:58:16 [master] pid:24637 Got response with status 200: {"sessionId":"2ef58ea8864a96aab301989f223c5513","status":0,"value":["CDwindow-7721FCD5-9322-974B-D3BB-EA0F6CE0D087"]}
    >> responseHandler.js:47:14 [master] pid:24637 Send HTTP Respone to Client: {"sessionId":"70212602-a312-47aa-92ea-9b61ddfbb530","status":0,"value":"[\"NATIVE_APP\",\"CDwindow-7721FCD5-9322-974B-D3BB-EA0F6CE0D087\"]"}
    >> responseHandler.js:11:12 [master] pid:24637 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/70212602-a312-47aa-92ea-9b61ddfbb530/context, jsonBody: {"name":"CDwindow-7721FCD5-9322-974B-D3BB-EA0F6CE0D087"}
    >> proxy.js:52:14 [master] pid:24637 Proxy: /wd/hub/session/temp/window_handles:GET to http://localhost:9515/wd/hub/session/2ef58ea8864a96aab301989f223c5513/window_handles:GET with body: {}
    >> proxy.js:58:16 [master] pid:24637 Got response with status 200: {"sessionId":"2ef58ea8864a96aab301989f223c5513","status":0,"value":["CDwindow-7721FCD5-9322-974B-D3BB-EA0F6CE0D087"]}
    >> proxy.js:52:14 [master] pid:24637 Proxy: /wd/hub/session/temp/window:POST to http://localhost:9515/wd/hub/session/2ef58ea8864a96aab301989f223c5513/window:POST with body: {"name":"CDwindow-7721FCD5-9322-974B-D3BB-EA0F6CE0D087"}
    >> proxy.js:58:16 [master] pid:24637 Got response with status 200: {"sessionId":"2ef58ea8864a96aab301989f223c5513","status":0,"value":null}
    >> responseHandler.js:47:14 [master] pid:24637 Send HTTP Respone to Client: {"sessionId":"70212602-a312-47aa-92ea-9b61ddfbb530","status":0,"value":null}
    >> responseHandler.js:11:12 [master] pid:24637 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/70212602-a312-47aa-92ea-9b61ddfbb530/element, jsonBody: {"using":"id","value":"pushView"}
    >> proxy.js:52:14 [master] pid:24637 Proxy: /wd/hub/session/70212602-a312-47aa-92ea-9b61ddfbb530/element:POST to http://localhost:9515/wd/hub/session/2ef58ea8864a96aab301989f223c5513/element:POST with body: {"using":"id","value":"pushView"}
    >> proxy.js:58:16 [master] pid:24637 Got response with status 200: {"sessionId":"2ef58ea8864a96aab301989f223c5513","status":0,"value":{"ELEMENT":"0.6726351859979331-1"}}
    >> session.js:108:14 [master] pid:24637 Send HTTP Respone to Client: {"sessionId":"70212602-a312-47aa-92ea-9b61ddfbb530","status":0,"value":"{\"ELEMENT\":\"0.6726351859979331-1\"}"}
    >> responseHandler.js:11:12 [master] pid:24637 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/70212602-a312-47aa-92ea-9b61ddfbb530/touch/click, jsonBody: {"element":"0.6726351859979331-1"}
    >> responseHandler.js:23:14 [master] pid:24637 Send HTTP Respone to Client: 404 Not Found
    >> responseHandler.js:11:12 [master] pid:24637 Recieve HTTP Request from Client: method: DELETE url: /wd/hub/session/70212602-a312-47aa-92ea-9b61ddfbb530, jsonBody: {}
    >> session.js:81:12 [master] pid:24637 Delete session, sessionId: 70212602-a312-47aa-92ea-9b61ddfbb530
    >> responseHandler.js:47:14 [master] pid:24637 Send HTTP Respone to Client: {"sessionId":"70212602-a312-47aa-92ea-9b61ddfbb530","status":0}
    >> macaca-chromedriver.js:123:18 [master] pid:24637 chromedriver exit with code: null, signal: SIGTERM
    
    

  • @xdf @junhe 求助求助,非常感谢了,我已经 google 了一轮,也看了 appium 类似的错误,但是没有解决

  • @xdf 感谢感谢

  • #1 楼 @neyo 我看了下 swift monkey 是侵入式的吧,我在 github 上面找了几个 monkey 测试工程,也都是,侵入性的,想问问大家,有没有非侵入式的实现

  • #4 楼 @ht 问题不在于是不同的驱动吧,我没有说让你了解 macaca-electron, 我说的是 electron, 你了解他是什么了么, electron 环境建立好了么,electron 应用有么?PS: 我能力有限,不必再 @ 我

  • #2 楼 @ht 建议你先了解下 electron 是什么

  • "browserName":"electron", 换成 chrome, chrome 浏览器能启动嘛

  • 已支持,加油