-1

I have tried with below coding to scroll the mobile web page .But,the scroll doesn't happening,it throws error message as element not found.

TouchActions action = new TouchActions(driver).scroll(0, 100);
            action.perform();
selvi
  • 1,271
  • 2
  • 21
  • 41
  • Share the error message here? @Selvi – A1ternat1ve Feb 24 '15 at 05:10
  • @A1ternat1ve Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 53.414 sec <<< FAILURE! scrollArticle(mobileweb.photocentric.ScrollArticleTest) Time elapsed: 3.896 sec <<< FAILURE! java.lang.ClassCastException: org.openqa.selenium.remote.RemoteWebDriver cannot be cast to org.openqa.selenium.interactions.HasTouchScreen at org.openqa.selenium.interactions.touch.TouchActions.(TouchActions.java:37) at mobileweb.photocentric.ScrollArticleTest.scrollArticle(ScrollArticleTest.java:36) – selvi Feb 24 '15 at 07:10

1 Answers1

1

you can easily notice that selendroid does not have scroll. http://selendroid.io/gestures.html As you can see on project website you should try:

#Please import: org.openqa.selenium.interactions.touch.TouchActions
WebElement pages = driver.findElement(By.id("vp_pages"));
TouchActions flick = new TouchActions(driver).flick(pages, -100, 0, 0);
flick.perform();

and if you just want to scroll from top to the down then change:

.flick(pages, -100, 0, 0);

to

.flick(pages, 0, 100, 0);