java-client
java-client copied to clipboard
Exception in thread "main" java.lang.ClassCastException: class org.openqa.selenium.remote.RemoteWebDriver cannot be cast to class io.appium.java_client.AppiumDriver (org.openqa.selenium.remote.RemoteWebDriver and io.appium.java_client.AppiumDriver are in unnamed module of loader 'app')
I want to do drag and drop operation on an android mobile browser.
Below are the dependencies I have in pom for selenium and appium
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>7.4.1</version>
</dependency>
I'm using this piece of code to perform drag and drop.
new AndroidTouchAction((PerformsTouchActions) driver).longPress(LongPressOptions.longPressOptions().withElement(ElementOption.element(source)))
.waitAction(WaitOptions.waitOptions(Duration.ofSeconds(2)))
.moveTo(ElementOption.element(target))
.release()
.perform();
Which is throwing this error :
"Exception in thread "main" java.lang.ClassCastException: class org.openqa.selenium.remote.RemoteWebDriver cannot be cast to class io.appium.java_client.AppiumDriver (org.openqa.selenium.remote.RemoteWebDriver and io.appium.java_client.AppiumDriver are in unnamed module of loader 'app')"
I recommend to bump the used dependencies