刷新功能在Appium

问题描述:

我想验证应用程序的刷新功能。为此,我必须执行下拉操作,而不是点击刷新按钮。怎么做。我正在使用Appium。 由于刷新功能在Appium

下面是滑动代码:

语法:driver.swipe(STARTX,startY,endX,恩迪,持续时间);

driver.swipe(400, 800, 400, 200, 2000); 
+0

是得到了它。我只能向上滚动。谢谢 –

+0

如果能为您工作,请您将此答案标记为“已接受”。这对其他人会有帮助。 – Vinod

你不应该使用swipe方法,因为它被标记deprecated,将被删除任何时间很快 相反,你应该使用TouchActions

Dimension screenSize = driver.manage().window().getSize(); 
new TouchAction(driver) 
    .press(screenSize.getWidth()/2, (int) (screenSize.height * 0.2)) 
    .waitAction(500) 
    .press(screenSize.getWidth()/2, (int) (screenSize.height * 0.8)) 
    .release() 
    .perform();