Search code examples
javaeclipseappiumxcuitest

I want to swipe to find/locate an element that is present down in an IOS App


I have an Ios app and I'm doing UI automation of it. I have an element/button that is one scroll down the page. I have seen that appium has depreciated most of the functions like scroll, moveto and swipe. since all of the help is related to that. I am using Appium Version 1.13.0 (1.13.0.20190505.5)


Solution

  • Use that method instead of appium methods:

    JavascriptExecutor js = (JavascriptExecutor) driver;
    HashMap<String, String> scrollObject = new HashMap<>();
    scrollObject.put("direction", "down");
    js.executeScript("mobile: swipe", scrollObject);
    

    change direction to up if you want to swipe up