【发布时间】:2019-10-14 17:45:07
【问题描述】:
如何在最新版本的 appium 中进行左右操作,因为我们在新的 appium 版本中没有 swipe(driver.swipe) 方法
public DailyPicksPage swipeDailyPicksCard() throws Exception {
Dimension size = agent.getMobileDriver().manage().window().getSize();
System.out.println("Dimensions of the screen" + size);
int startX = (int) (size.width * 0.80);
int endX = (int) (size.width * 0.20);
int width = size.width;
int duration = 2000;
int height = size.height;
int pressHeight = (int) (height * 0.80);
new TouchAction(agent.getMobileDriver()).press(PointOption.point(startX, pressHeight)).waitAction(WaitOptions.waitOptions(Duration.ofMillis(duration))).moveTo(PointOption.point(endX, pressHeight)).release().perform();
return new DailyPicksPage(params, agent);
}
【问题讨论】:
标签: selenium-webdriver appium ui-automation