zoukankan      html  css  js  c++  java
  • android 自动化测试案例之 MonkeyScript

    #文件名 MonkeyScript.mks
    #功能: 使用monkey script测试app,此案例是测试搜索功能(输入关键字,然后点击搜索按钮)
    #参考: http://blog.csdn.net/superloveboy/article/details/48469393
    # http://yiweifen.com/html/news/WaiYu/13792.html
    # http://androidxref.com/5.1.1_r6/xref/development/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java
    # android.view.KeyEvent.java

    #可以使用 Android/sdk/tools/uiautomatorviewer.bat 获取坐标点

    #执行方式 拷贝文件到手机上 比如/sdcard/00/MonkeyScript.mks,运行"adb shell monkey -f /sdcard/00/MonkeyScript.mks 10"(不包括引号)
    #-f后面为脚本文件的路径,最后一个数字表示脚本执行的次数

    #下面的这4行是固定值,不用修改,表示脚本的开头
    type = user
    count = 10
    speed = 1.0
    start data >>

    #启动activity
    LaunchActivity(com.iotlife.action,com.iotlife.action.activity.SearchDetailActivity)
    #等待ms时间
    UserWait(200)

    #DispatchPointer为点击某个坐标点,只关注第3,4,5个参数
    #第三个参数为事件类型(0为down,1为up),第4,5参数为坐标点x,y
    #也可以用 Tap(1000,100) 代替
    DispatchPointer(10,10,0,400,100,0,0,0,0,0,0,0);
    DispatchPointer(10,10,1,400,100,0,0,0,0,0,0,0);
    UserWait(300)

    #输入一个字符串
    DispatchString(test)
    #输入一个回车键
    DispatchPress(KEYCODE_ENTER)
    UserWait(300)


    #DispatchPointer(10,10,0,1000,100,0,0,0,0,0,0,0);
    #DispatchPointer(10,10,1,1000,100,0,0,0,0,0,0,0);
    UserWait(300)

  • 相关阅读:
    python pandas groupby
    ORC 资料Mark
    python split() 用法
    Hive 中的变量
    特征选择方法
    Introduction to SIFT (Scale-Invariant Feature Transform)
    SIFT 、Hog 、LBP 了解
    python None 和 NaN
    判断特征中是否含有空值、空值填充
    vue 子组件引用
  • 原文地址:https://www.cnblogs.com/Westfalen/p/7058755.html
Copyright © 2011-2022 走看看