qileilove

blog已经转移至github,大家请访问 http://qaseven.github.io/

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

 为了实现自动定时的运行脚本,我们需要在命令行运行和启动脚本,具体代码如下:
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  指定输出结果存放的路径,需要在前后加上双引号。
  5. 如果需要在真机运行,在-t 参数前加上  -w UDID, 其中UDID为被连接手机的设备标识(可通过iTools查看)。
  举例在我本地模拟器上的脚本如下:
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: 登录界面测试实例

posted on 2014-05-16 11:02 顺其自然EVO 阅读(251) 评论(0)  编辑  收藏 所属分类: selenium and watir webdrivers 自动化测试学习


只有注册用户登录后才能发表评论。


网站导航:
 
<2014年5月>
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

导航

统计

常用链接

留言簿(55)

随笔分类

随笔档案

文章分类

文章档案

搜索

最新评论

阅读排行榜

评论排行榜