I’m trying to scroll my country list to find specific country and after first attempt list is shaking which provides error.
Video with app behaviour:
https://youtube.com/shorts/6SOI4YQbJlk?feature=share
Code:
public void tapOnElementByText(String element) {
HashMap<String, Object> scrollObject = new HashMap<>();
JavascriptExecutor js = driver;
scrollObject.put("direction", "down");
js.executeScript("mobile: scroll", scrollObject);
try {
driver.findElementByIosNsPredicate("label == \"" + element + "\"").click();
} catch (NoSuchElementException exception) {
System.out.println("Element not found");
}
}
I tried all kind of stuff from stackoverflow and appium tutorial(http://appium.io/docs/en/writing-running-appium/tutorial/swipe-tutorial/), but it didn’t helped me