Hello appium community.
So the app im testing has a seekbar that you can drag to the left, once you drag enough a value changes. So I basically I wanna try drag the slider to the left until a value changes.
Now my problem:
Every test I’ve done I get “org.openqa.selenium.remote.RemoteWebDriver cannot be cast to org.openqa.selenium.interactions.HasTouchScreen” error.
I’ve tried
import org.openqa.selenium.interactions.touch.TouchActions;
import io.appium.java_client.TouchAction;
When I use the io.appium.java_client.TouchAction; it complains my “new TouchAction(driver)” isn’t using MobileDriver type. Am I supposed to use MobileDriver? Feels odd since Im using WebDriver every other place in my tes, what am I missing?
Example code of my latest try to drag the slider to the left
int xAxisStartPoint = Slider.getLocation().getX() +Slider.getSize().getWidth();
int yAxis = Slider.getLocation().getY()+Slider.getSize().getHeight();
new TouchActions(driver).down(xAxisStartPoint, yAxis).move(150, 0).perform();
This code results with me getting the "cannot be cast to org.openqa.selenium.interactions.HasTouchScreen error.
Appreciate all help. Cheers
Edit, android, java,