uiautomator执行命令详解

uiautomator一般由adb shell调用,也可以在手机端使用runTime执行。使用adb shell uiautomator helper可以查看到uiautomator所有的命令uiautomator的执行测试用例的命令如下:#adb shell uiautomator runtest $jar_name -c $test_class_or_metho...
摘要由CSDN通过智能技术生成

uiautomator一般由adb shell调用,也可以在手机端使用runTime执行。使用 adb shell uiautomator helper可以查看到uiautomator所有的命令

 

uiautomator的执行测试用例的命令如下:

#adb  shell  uiautomator  runtest  $jar_name  -c  $test_class_or_method [options]

 

下面详细的说一下命令:

1、runtest

runtest是执行测试的关键命令,用来执行jar包的测试用例。

 

2、jar_name

用于指定需要执行的测试用例所在的jar包名称,使用相对路径(uiautomator的jar包放置在安卓手机的/data/local/tmp/目录下),可以多指定jar包。

(1)若只存在一个测试jar包 A.jar,命令如下:

     #adb  shell  uiautomator  runtest  A.jar  -c  $test_class_or_method  [options]

(2)若 A.jar 测试过程中引入了第三方的jar包 B.jar ,则并列写,中间使用空格分隔即可,命令如下:

     #adb  shell  uiautomator  runtest  A.jar  B.jar  -c  $test_class_or_method  [options]

 

3、-c  $test_class_or_method

用于指定具体的case,参数指定时需要写全全量路径(包名 .class#method),可以有三种指定方式。

假设 A.jar 中存在两个测试类 C.java、D.java,分别测试方法 C.testC_e,C.testC_f&#

  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值