Android - App intro slider

Hi Sir,

Please help me, how to automate the Android app intro slider screens in appium.

I would have been used the below mentioned function to reach to the screen where there is the continue/skip button(the end of app intro screens):

driver.swipe(startx, starty, endx, endy, duration);

Thank you for your response.
Swipe event is not listed in driver.

driver.swipe was removed on newer java client versions.

Look around for TouchAction class and how it works

Thank you for your reply.
I have used the TouchAction class for swipe as below, its working but am looking swipe right from left.

TouchAction ts = new TouchAction(driver);
ts.press(500,700).moveTo(500,-700).release().perform();

Requirements:
Android App intro slider screens - swipe right to left.
Reference: https://www.androidhive.info/2016/05/android-build-intro-slider-app/

Could you share coordinate values for my requirements.

With:

 driver.manage().window().getSize()

you will get the width and height of the device you using. So from there you can calculate the coordinates needed for that specific device - Don’t use hard coded coordinates, calculate them always for the device you using in runtime.

    I have tried but getting error.

    Dimension size = driver.manage().window().getSize();
    System.out.println(size);
    int startx = (int) (size.width * 0.70);
    int endx = (int) (size.width * 0.30);
    int starty = size.height / 2;

ts.press(startx,starty).moveTo(endx,starty).release().perform();
or
ts.press(endx,starty).moveTo(startx,starty).release().perform();

Error:
Exception in thread “main” org.openqa.selenium.interactions.InvalidCoordinatesException: The coordinates provided to an interactions operation are invalid. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds