I am doing automation testing on my Android app and am required to scroll in order to get visible the fields which are required to get scrolled.
I tried using the below code from here:
TouchActions action = new TouchActions(driver);
action.scroll(element, 10, 100);
action.perform();
After running this code it is giving me this error:
java.lang.ClassCastException:
io.appium.java_client.android.AndroidDriver cannot be cast to
org.openqa.selenium.interactions.HasTouchScreen
Well, I know I've passed the driver in TouchActions
which is of type AndroidDriver
.
How would I fix this?