zoukankan      html  css  js  c++  java
  • UiAutomator--UiAutomatorHelper快速调试

    UiAutomatorHelper使用
        
    1.介绍:
    他是一种可以快速调试的方法;其本身也是java问津相当于自动化脚本,查看该文件,其主要实现的功能如下
      1.创建build:android create uitest-project -n <jars> -t 1 -p <project workspace>
      2.修改build文件:进入工作空间,打开build.xml文件,将第二行的help修改为build
      3.开始编译:ant -buildfile <build.xml文件路径>
      4.push文件:adb push <path_to_out_jar> /data/local/tmp/
      5.运行测试脚本:adb shell uiautomator runtest <jars>-c <包名>.<类名>[#testname]

    2.下载安装

      1.下载UiAutomatorHelper.java 地址:http://download.csdn.net/detail/lihongjian944043440/9361073

      2.导入UiAutomatorHelper.java

      选择你写测试代码的包,右键--import--general--file System

      

    选择UiAutomatorHelper.java所在文件夹,然后勾选UiAutomatorHelper.java,如下图,这样就导入成功啦

    3.使用方式

      1.首先按照正常流程写好测试用例
      2.将UiautomatorHelper.java导入到该测试用例所在项目包下
      3.在你的测试用例类文件末尾加入代码:

    1. public static void main(String[] args){  
    2.     String jarName,testClass, testName,androidId;  
    3.     jarName="test1";//生成的jar包名  
    4.     testClass="com.li.test1";//测试包名  
    5.     testName="testDemo";//测试类名  
    6.     androidId="1";//对应androidSDK版本  
    7.       
    8.     new UiAutomatorHelper(jarName, testClass, testName, androidId);  
    9. }  

     

       

  • 相关阅读:
    sql优化-使用exists代替distinct
    count(*),count(1),count(c_bh)效率问题
    nulls last和null first
    连表更新
    postgresql-删除重复数据保留一条
    postgresql批量插入
    pg中join,left join的使用,将条件放到on和where后面的区别问题
    pg关于not in和not exists的使用
    postgresql关于in和exists使用
    postgresql无序uuid性能测试
  • 原文地址:https://www.cnblogs.com/WXBai/p/5996814.html
Copyright © 2011-2022 走看看