Motion Gestures Swipe skips over the area I want to reach
public static void swipeUp60(AppiumDriver appiumdriver) {
((JavascriptExecutor) appiumdriver).executeScript(“mobile: swipeGesture”, ImmutableMap.of(
“left”, 400, “top”, 900, “width”, 400, “height”, 900,
“direction”, “up”,
“percent”, 0.60
));
}
public static void swipeDown40(AppiumDriver appiumdriver) {
((JavascriptExecutor) appiumdriver).executeScript("mobile: swipeGesture", ImmutableMap.of(
"left", 400, "top", 900, "width", 400, "height", 900,
"direction", "down",
"percent", 0.40
));
}
List <WebElement> propertypiclist = (List<WebElement>) driver.findElements(propertypic);
WebElement property1pic = propertypiclist.get(0);
property1pic.click();
Thread.sleep(4000);
MiscMethods.swipeUp60(driver);
Thread.sleep(4000);
MiscMethods.swipeDown40(driver);
Thread.sleep(4000);
WebElement listingDetailsElement = wait.until(ExpectedConditions.elementToBeClickable(listingDetails));
listingDetailsElement.click();
Page starts like this
I want to go to middle next page
But the swipe takes me to the end of the page here