使用节点时无法运行iOS Appium测试

时间:2016-04-12 18:29:06

标签: node.js selenium-webdriver appium appium-ios

我一直在使用Appium.app运行我的iOS appium测试而没有问题。

我想尝试使用node + appium包,但我遇到了下面显示的错误。

我已尝试重新安装节点以及appium和wd软件包,但问题仍然存在。我也允许OSX接受来自节点的传入连接。

我的环境未发现任何问题: appium-doctor --ios

Appium日志:

[Appium] Welcome to Appium v1.5.1 (REV c330ee9862bbc0db7d604e3b395cd1226417a9b9)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"iOS","platformVersion":"9.3","deviceName":"iPhone 6s","app":"/Users/User/Downloads/AppToTestSimulator.app (5).zip","autoAcceptAlerts":"false","appium_version":"1.5.1"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"platformName":"iOS","platformVersion":"9.3","deviceName":"iPhone 6s","app":"/Users/User/Downloads/AppToTestSimulator.app (5).zip","aut...
[Appium] Creating new IosDriver session
[Appium] Capabilities:
[Appium]   platformName: 'iOS'
[Appium]   platformVersion: '9.3'
[Appium]   deviceName: 'iPhone 6s'
[Appium]   app: '/Users/User/Downloads/AppToTestSimulator.app (5).zip'
[Appium]   autoAcceptAlerts: 'false'
[Appium]   appium_version: '1.5.1'
[BaseDriver] Capability 'autoAcceptAlerts' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] The following capabilities were provided, but are not recognized by appium: appium_version.
[BaseDriver] Session created with session id: bc760657-425f-4b2a-a6a7-b0e96b3f7c01
[debug] [iOS] Not auto-detecting udid.
[BaseDriver] Using local app '/Users/User/Downloads/AppToTestSimulator.app (5).zip'
[debug] [BaseDriver] Copying local zip to tmp dir
[debug] [BaseDriver] Unzipping /var/folders/6v/w_s4j0fj27b1lnk8rnj0k4thvgjb4k/T/2016312-21862-1sug2zc/appium-app.zip
[debug] [BaseDriver] Testing zip archive: /var/folders/6v/w_s4j0fj27b1lnk8rnj0k4thvgjb4k/T/2016312-21862-1sug2zc/appium-app.zip
[BaseDriver] Unzipped local app to '/var/folders/6v/w_s4j0fj27b1lnk8rnj0k4thvgjb4k/T/2016312-21862-1sug2zc/AppToTest.app'
[debug] [iOS] Removing any remaining instruments sockets
[debug] [iOS] Cleaned up instruments socket /var/folders/6v/w_s4j0fj27b1lnk8rnj0k4thvgjb4k/T/instruments_sock
[debug] [iOS] Setting Xcode version
[debug] [iOS] Xcode version set to 7.3
[debug] [iOS] Setting iOS SDK Version
[debug] [iOS] iOS SDK Version set to 9.3
[debug] [iOS] Checking whether instruments supports our device string
[debug] [Instruments] Getting list of devices instruments supports
[debug] [Instruments] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
[debug] [Instruments] Available devices: Apple TV 1080p (9.2) [A350CABB-DB34-4933-8C8D-94BE4E695BD9] (Simulator),iPad 2 (8.4) [8FF96C8F-5BAB-4863-945C-62C92F9F7C91] (Simulator),iPad 2 (9.3) [74017AF7-1E44-4708-BA84-3BD09E5A50AD] (Simulator),iPad Air (8.4) [018AD91A-560B-475B-8E59-4633D4E4F70F] (Simulator),iPad Air (9.3) [441357FB-6D52-41E4-8AA3-682BE3A1CA03] (Simulator),iPad Air 2 (9.3) [5D925D0C-7FA2-4CEE-BE47-85E0DACFA67A] (Simulator),iPad Pro (9.3) [BADE2306-4190-44F8-A88A-21BC19137589] (Simulator),iPad Retina (8.4) [6436FE08-5493-4E95-9AB0-8CDB5EB14FC9] (Simulator),iPad Retina (9.3) [EDDB468C-EA62-443F-B273-FEC00F96FA6B] (Simulator),iPhone 4s (8.4) [DA7DF90E-7EB9-4199-ABE8-1DF2B89C593B] (Simulator),iPhone 4s (9.3) [64305631-8F8E-4DFF-BF10-6254B30C885A] (Simulator),iPhone 5 (8.4) [A2E02B24-E960-4182-8B1D-5EE633E64E4D] (Simulator),iPhone 5 (9.3) [3610DBC3-1F8E-48F3-8E86-93E2DCD28B3C] (Simulator),iPhone 5s (8.4) [385EBC18-FBEE-43D3-8A9F-ED6FB9E17D99] (Simulator),iPhone 5s (9.3) [1177F60B-F9A5-4D6E-B9E7-00F172ECB09C] (Simulator),iPhone 6 (8.4) [1CB02197-3B62-444F-B745-11884344D226] (Simulator),iPhone 6 (9.3) [F05E7BCD-1A83-4F64-8C43-9D6320116780] (Simulator),iPhone 6 Plus (8.4) [4683EB66-6644-4D3B-997B-6A417C9C7C5C] (Simulator),iPhone 6 Plus (9.3) [72630DFB-B5B1-4D79-B7C3-DAF39E1EE0F6] (Simulator),iPhone 6s (9.3) [4116EA28-E0C2-45F2-A201-22C3B1CAFBE3] (Simulator),iPhone 6s (9.3) + Apple Watch - 38mm (2.2) [D8DD477B-D5C4-4575-A83B-C5D95D40A1E1] (Simulator),iPhone 6s Plus (9.3) [7716603A-2DAE-439D-A59A-AA561C90D888] (Simulator),iPhone 6s Plus (9.3) + Apple Watch - 42mm (2.2) [A4FE07E7-4CC4-4507-AE70-E07B7EC0DE21] (Simulator)
[iOSSim] Retrieving device name string for Xcode version 7.3
[debug] [iOSSim] Getting device string from options: {"deviceName":"iPhone 6s","platformVersion":"9.3","forceIphone":false,"forceIpad":false}
[debug] [iOSSim] Fixing device. Changed from 'iPhone 6s' to 'iPhone 6s (9.3) ['
[debug] [iOSSim] Final device string is 'iPhone 6s (9.3) ['
[debug] [iOS] iOS sim UDID is 4116EA28-E0C2-45F2-A201-22C3B1CAFBE3
[iOSSim] Constructing iOS simulator for Xcode version 7.3
[debug] [iOS] No language specified. Using default strings
[debug] [iOS] Strings file not found. Looking in 'en.lproj' directory
[iOS] Could not file localizable strings file 'Localizable.strings'!
[debug] [ios-app-utils] Getting bundle ID from app
[iOS] Extracted bundleID: us.AppToTest.AppToTestPreprod from app: /var/folders/6v/w_s4j0fj27b1lnk8rnj0k4thvgjb4k/T/2016312-21862-1sug2zc/AppToTest.app
[debug] [iOS] Creating instruments
[debug] [UIAuto] Preparing bootstrap code
[debug] [UIAuto] Dynamic bootstrap dir: /Users/User/Library/Application Support/appium/bootstrap
[debug] [UIAuto] Dynamic env: {"nodePath":"/usr/local/bin/node","commandProxyClientPath":"/usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js","instrumentsSock":"/var/folders/6v/w_s4j0fj27b1lnk8rnj0k4thvgjb4k/T/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"oneByOne"}
...bug] [UIAuto] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
[debug] [UIAuto] Dynamic bootstrap path: /Users/User/Library/Application Support/appium/bootstrap/bootstrap-f8e8ef362019f9d8.js
[debug] [UIAuto] Reusing dynamic bootstrap: /Users/User/Library/Application Support/appium/bootstrap/bootstrap-f8e8ef362019f9d8.js
[debug] [iOS] User specified default device, letting instruments launch it
[debug] [iOS] Running ios sim reset flow
[debug] [iOS] Killing the simulator
[debug] [iOSSim] Killing all iOS Simulators
[MJSONWP] Encountered internal error running command: Error: Condition unmet after 60011 ms. Timing out.
    at spin$ (lib/asyncbox.js:118:13)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:294:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    at run (/usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:89:39)
    at /usr/local/lib/node_modules/appium/node_modules/asyncbox/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:100:28
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)
[HTTP] <-- POST /wd/hub/session 500 62780 ms - 180 

1 个答案:

答案 0 :(得分:0)

我通过重新安装x-code并执行&#39; sudo authorize-ios&#39;来解决了这个问题。命令。后者可能是唯一需要的东西。