我使用了本網站的模板:http://blog.manbolo.com/2012/04/08/ios-automated-tests-with-uiautomation,並創建了自己的命令行來運行終端上的自動化測試。無法運行iOS UI自動化命令行
這裏有一些關於我的腳本的一些有用信息:
我使用的Xcode 6.4。
我在Xcode儀器中運行了這個自動化腳本,它工作正常。
這裏是我的命令行:
instruments -w 927b666816e2d4377b208a872b42a1d3xxxxxxxx -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate ConsumeriOS -e UIASCRIPT/Users/wendywang/Documents/TIO/ConsumeriOS/ConsumeriOS/ConsumeriOSTests/automationScript/LogIn.js
但我收到此錯誤:
2015-10-05 14:16:34.122 instruments[23330:551118] WebKit Threading Violation - initial use of WebKit from a secondary thread. Instruments Usage Error : Failed to resolve target for Instrument 'Automation' instruments, version 6.4 (57082) usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]] tio-spare:~ wendywang$ ConsumeriOS -e UIASCRIPT /Users/wendywang/Documents/xxx/ConsumeriOS/ConsumeriOS/ConsumeriOSTests/automationScript/LogIn.js -bash: ConsumeriOS: command not found
我仔細檢查了該
- 的UDID是正確的
- 自動化跟蹤模板是在正確的道路
- 的LogIn.js文件是正確的路徑
有一件事我不知道:
的ConsumeriOS是代碼的名稱。但是在代碼中,它實際上可以生成一些應用程序。我正在測試名爲Consumer的應用程序。所以我不確定是否應該將ConsumeriOS作爲應用程序的名稱或消費者來編寫。
有誰知道它爲什麼會產生這個錯誤?謝謝!
謝謝!我掌握了它:) – munmunbb