This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 3
Feb 2019

Hi, I am trying to get my AndroidDriver to scroll.

I am trying this:

WebElement secret = driver.findElement(By.id(“com.xxx.verifyxxxtestapp:id/oauth2_resource_edittext”));
TouchActions action = new TouchActions(driver);
action.scroll(secret, 10, 100);
action.perform();

But I get this:
java.lang.ClassCastException: io.appium.java_client.android.AndroidDriver cannot be cast to org.openqa.selenium.interactions.HasTouchScreen

I have imported: import org.openqa.selenium.interactions.touch.TouchActions; as that was the only class available to import. Should I be using an Appium on einstead?

  • created

    Feb '19
  • last reply

    Feb '19
  • 2

    replies

  • 164

    views

  • 2

    users

  • 1

    like

  • 1

    link

Thanks mashKrum. I’ve got it to work using the following code to scroll by moving from one element location to another…thanks again :slight_smile:

    WebElement resource = driver.findElement(By.id("com.xxx.verify.xxxtestapp:id/oauth2_resource_edittext"));
    WebElement openid = driver.findElement(By.id("com.xxx.verify.xxxtestapp:id/oauth2_scope_edittext"));
    TouchAction action = new TouchAction(driver);
    action.press(resource).moveTo(openid).release();
    action.perform();