Android - Appium Swipe down not working

后端 未结 2 1340
遇见更好的自我
遇见更好的自我 2020-12-18 10:28

I am trying to swipe down contact screen but its not working.

Here is the code I have tried.

public void Swipedown() throws InterruptedException
{
         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-18 11:25

    Use this code to swipe up and down

    TouchAction t=new TouchAction(driver);
    
    //long press, for atleast 1 sec first and move the object
    
            WebElement First=driver.findElementByXPath("//*[@***First Element Path***]");
    
            WebElement second=driver.findElementByXPath("//*[@***Second Element Path***]");
    t.longPress(longPressOptions().withElement(element(First)).withDuration(ofSeconds(3))).moveTo(element(second)).release().perform();
    

    Hope this helps :)

提交回复
热议问题