TouchActions

PHOTO EMBED

Sat May 27 2023 07:20:12 GMT+0000 (Coordinated Universal Time)

Saved by @mehran

PerformsTouchActions performsTouchActions = (PerformsTouchActions) driver;
    
    // Get the size of the screen
    Dimension size = driver.manage().window().getSize();
    
    // Set the starting and ending coordinates for the swipe action
    int startX = size.width / 2;
    int startY = (int) (size.height * 0.8);
    int endY = (int) (size.height * -0.1);
    
    // Perform the swipe action
    TouchAction touchAction = new TouchAction(performsTouchActions);
    touchAction.press(PointOption.point(startX, startY))
               .moveTo(PointOption.point(startX, endY))
               .release()
               .perform();
content_copyCOPY