UIAutomation: 通过命令行运行测试用例

时间:2014-05-13 15:10:01   收藏:0   阅读:246

    为了实现自动定时的运行脚本,我们需要在命令行运行和启动脚本,具体代码如下:

instruments -t 
/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate
<full_path_to_application> 
-e UIASCRIPT <path_to_script.js>
-e UIARESULTSPATH <output_results_path>


1.  -t 后面的参数为 Automation.tracetemplate 的路径,每个版本的位置都有所不同,在命令行下使用 instruments -s 命令进行查询。
2.  full_path_to_application 是你的的被测应用的完整目录,需要在前后加上双引号。
3.  -e UIASCRIPT  指定执行的 js 脚本存放的位置,需要在前后加上双引号。
4.  -e UIARESULTPATH  指定输出结果存放的路径,需要在前后加上双引号。


举例在我本机上的脚本如下:

instruments -t 
/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate 
"/Users/wangxinxin/Library/Developer/Xcode/DerivedData/TestAutomation-ahmqgmqipyidexemazbprqxqkrya/Build/Products/Debug-iphonesimulator/TestAutomation.app" 
-e UIASCRIPT "/Users/wangxinxin/Documents/TestAutomation/test.js" 
-e UIARESULTSPATH "/Users/wangxinxin/Documents/TestAutomation"


UIAutomation: 通过命令行运行测试用例,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!