0
votes

I am trying to use java script scroll command to scroll the page while automating android mobile native application to scroll the window dowm .But I am Getting error message : org.openqa.selenium.WebDriverException: Not yet implemented. Please help us: http://appium.io/get-involved.html

Can you please tell me how to scroll down in Android mobile native application using Appium and Selenium Webdriver command.

1
Could you put here Java script command? - Palak

1 Answers

0
votes

This message indicates that using javascript commands are not yet available for Android

All I can suggest is update appium when available, I'm sure they will implement it at some point.

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

Here's a method I use to touch swipe

ONLY TESTED ON IOS

public static void touchSwipe(int startX, int startY, int endX, int endY) throws WebDriverException{
    JavascriptExecutor js = (JavascriptExecutor) TestSetup.AppElements.driver;
    js.executeScript("target.frontMostApp().mainWindow().scrollViews()[0].dragInsideWithOptions({startOffset:{x:0." + startX + ", y:0." + startY + "}, endOffset:{x:0." + endX + ", y:0." + endY + "}});");
}

Example The swipe ints that you enter, should depend on where your view is.

@Test
public void myTest() throws Exception {
    touchSwipe(75, 50, 75, 1); //Swipe downwards
}