Vertical swipe to a particular element on page in iOS device is not working with Appium 1.10.
Tried on iOS versions 9, 10, 11 on different iPhones but still not working.
We have tried the below code for vertical swipe but it is not working:
((IOSDriver<WebElement>) webDriver).swipe(
webDriver.manage().window().getSize().width / 2,
webDriver.manage().window().getSize().height * 7 / 12,
webDriver.manage().window().getSize().width / 2,
webDriver.manage().window().getSize().height / 2, 0);
Below code worked only to scroll down to the bottom of the page but not to the particular element.
JavascriptExecutor js = (JavascriptExecutor) webDriver;
HashMap<String, String> scrollObject = new HashMap<String, String>();
scrollObject.put(“direction”, “down”);
js.executeScript(“mobile: scroll”, scrollObject);
After that we have used the Touch Action class to swipe down but still not working:
Dimension size = driver.manage().window().getSize();
int endPoint = (int) (size.width * 0.20);
int startPoint = (int) (size.width * 0.80);
int anchor = size.height/2;
new TouchAction(driver).press(anchor, startPoint).waitAction(Duration.ofSeconds(0)).moveTo(anchor, endPoint).release().perform();