Hi, I am looking for a general scroll method for IOS and Android.
It should be able to work on hybrid, native and web apps.
Looking forward for comments.
public static void scrollFullScreenDown() { switch (getPlatform()) { case IOS: { Dimension size = getIOSDriver().manage().window().getSize(); TouchAction scroll = new TouchAction(getIOSDriver()); int startx = size.getWidth() / 2; int starty = (int) (size.getHeight() * 0.8); scroll.press(startx, starty).moveTo(0, (starty * -1)).release().perform(); } break; case Android: { Dimension size = getAndroidDriver().manage().window().getSize(); TouchAction scroll = new TouchAction(getAndroidDriver()); int startx = size.getWidth() / 2; int starty = (int) (size.getHeight() * 0.8); scroll.press(startx, starty).moveTo(startx, (starty * -1)).release().perform(); } break; } }
Thanks for the response. I will check it.
But what about FullScreenDown method?
Looking forward for your response.