Cannot swipe on appium iOS test

0
0

In the documentation, appium presents the following option for java:

JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, Double> swipeObject = new HashMap<String, Double>();
swipeObject
.put("startX", 0.01);
swipeObject
.put("startY", 0.5);
swipeObject
.put("endX", 0.95);
swipeObject
.put("endY", 0.5);
swipeObject
.put("duration", 1.8);
js
.executeScript("mobile: swipe", swipeObject);

I integrated this in my test, but after navigating to the screen where swipe would be available, the method with swipe won’t perform the action… In the failure exception panel I receive the following error: “org.openqa.selenium.WebDriverException: Not yet implemented”.

I want to swipe from left to right, but did not find another solution yet…

UPDATE:
I have managed to swipe by using the following code:

HashMap scrollObject = new HashMap();{{
scrollObject
.put("direction", "left");
}};
((RemoteWebDriver) driver).executeScript("mobile: scroll", scrollObject);

The problem is, that it will only swipe once, even if used multiple times… any ideas on how to solve this?

  • You must to post comments
0
0

How about using IOSDriver (driver) and calling the following:

    driver.swipe(100, 100, 500, 500, 500);
  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website