right to left swipe in android appium

半世苍凉 提交于 2021-01-29 19:26:36

问题


I tried executing the swipe operation i.e. right to left swipe with the following method. I am getting the result as pass but the operation is not getting performed.

Can you guys check and let me know what coordinates I should keep in order to make this functional.

//Horizontal Swipe by percentages

public void horizontalSwipeByPercentage (double startPercentage, double endPercentage, double anchorPercentage, int duration) {

Dimension size = driver.manage().window().getSize();

int anchor = (int) (size.height * anchorPercentage);

int startPoint = (int) (size.width * startPercentage);

int endPoint = (int) (size.width * endPercentage);

new TouchAction(driver)

        .press(point(startPoint, anchor))

        .waitAction(waitOptions(ofMillis(1000)))

        .moveTo(point(endPoint, anchor))

        .release().perform();

}

public void horizontalSwipe()

  {

    

        horizontalSwipeByPercentage (0.9,0.01,0.5,3000);

    }

Default test

Tests run: 1, Failures: 0, Skips: 0

===============================================

===============================================

Default suite

Total tests run: 1, Passes: 1, Failures: 0, Skips: 0

===============================================

来源:https://stackoverflow.com/questions/64604194/right-to-left-swipe-in-android-appium

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!