Scrolling method not supported in android appium

I tried using the swipe method in android, but it does not work.

The code: -

public void swipe() {
    JavascriptExecutor js = (JavascriptExecutor) driver;
    HashMap < String, Double > swipeObject = new HashMap < String, Double > ();
    swipeObject.put("startX", 0.95);
    swipeObject.put("startY", 0.5);
    swipeObject.put("endX", 0.05);
    swipeObject.put("endY", 0.5);
    swipeObject.put("duration", 1.0);
    js.executeScript("emulator: swipe", swipeObject);
}

Error: -

org.openqa.selenium.WebDriverException: Not yet implemented.

Any help in excellent use.

+4
source share
3 answers

Changing the context to NATIVE_APPworked for me:

String originalContext = driver.getContext();
driver.context("NATIVE_APP");
driver.swipe(startx, starty, endx, endy, duration);
driver.context(originalContext );
+2
source

Scrolling is not implemented / supported in web views, check the context and change it to Native before doing swipe, you can return to the web view after scrolling.

+1
source

appium, mac.

500 , , ?

0
source

All Articles