android UiAutomator分享几个简单实用的自定义方法
来源:互联网 发布:shell 按行读取数据 编辑:程序博客网 时间:2024/05/28 15:32
做自动化测试的时候,自己很喜欢能少敲一些代码,少做一些重复的事情,本着能省则省的原则,很多两行的都能写成一行,分享几个滑动的自定义方法。
public void swipeLeft() {//左滑
int y = UiDevice.getInstance().getDisplayHeight();
int x = UiDevice.getInstance().getDisplayWidth();
UiDevice.getInstance().swipe(x-100, y/2, 100, y/2, 8);
sleep(150);
}
public void swipeRight() {//右滑
int y = UiDevice.getInstance().getDisplayHeight();
int x = UiDevice.getInstance().getDisplayWidth();
UiDevice.getInstance().swipe(100, y/2, x-100, y/2, 8);
sleep(150);
}
public void swipeDown() {//下滑
int y = UiDevice.getInstance().getDisplayHeight();
int x = UiDevice.getInstance().getDisplayWidth();
UiDevice.getInstance().swipe(x/2, 200, x/2, y-200, 8);
sleep(150);
}
public void swipeUp() {//上滑
int y = UiDevice.getInstance().getDisplayHeight();
int x = UiDevice.getInstance().getDisplayWidth();
UiDevice.getInstance().swipe(x/2, y-200, x/2, 200, 8);
sleep(150);
}
- android UiAutomator分享几个简单实用的自定义方法
- 分享几个android实用的网站
- android UiAutomator自定义一个判断当前版本的方法
- 简单实用的分享
- Android简单实用的自定义Dialog
- 几个实用的自定义函数
- 几个简单实用的javascrit
- android UiAutomator自定义输出方法时,需要方法重载的另一种解决方案
- 分享几个实用的JQ代码
- 分享几个实用的过滤函数
- android:自定义SeekBar(简单实用)
- Android 自定义简单实用Dialog
- NSNumer 的几个实用方法
- android uiautomator自动化测试中写一个自定义的方法减少代码量
- android uiautomator自定义方法输出yyyy-MM-dd HH:mm:ss的时间
- android UiAutomator多一个参数让自己的自定义方法更灵活
- Android UiAutomator: 中文字符的输入方法
- android uiautomator计算时间差的方法
- 简单错误记录
- [学习记录]Mysql使用TRIGGER自动生成订单号
- SecureCRT串口配置+开发板啊调试出现问题
- eclipse 当中,修改文本编辑框的字体大小
- linux gt9xx
- android UiAutomator分享几个简单实用的自定义方法
- 视频随机
- ECMASCRIPT6的异步编程解决方案
- 什么是I帧,P帧,B帧
- HTML5 5大存储方式总结
- javaScript中的BOM对象-navigator和cookies(4)
- 插件相关(cocos2d)
- 焦点的用法,实现获取焦点清空失去焦点提示效果
- 欢迎使用CSDN-markdown编辑器