appium向右滑动
/***
* 右滑1/2屏幕
/
public static void slideRight(){
int x=driver.manage().window().getSize().width;
int y=driver.manage().window().getSize().height;
driver.swipe(x/41, y/2, x/4*3, y/2, 0);
}
/***
/***
* 特殊右滑
* @param 传入从上到下宽度的百分比(1-99之间)
/
public static void slideRight(int i){
Assert.assertFalse("左滑宽度传入错误", i<=0||i>=100);
int x=driver.manage().window().getSize().width;
int y=driver.manage().window().getSize().height;
driver.swipe(x/42, y/10*i, x/4*3, y/10*i, 0);
}
如果您认为阅读这篇博客让您有些收获,不妨点击一下右下角的【推荐】
本文版权归作者和博客园共有,欢迎转载

浙公网安备 33010602011771号