java-client icon indicating copy to clipboard operation
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')

Open sharutkarsh opened this issue 2 years ago • 1 comments

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

org.seleniumhq.selenium selenium-java 3.141.59
    <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')"

sharutkarsh avatar Feb 09 '23 23:02 sharutkarsh

I recommend to bump the used dependencies

valfirst avatar Feb 10 '23 07:02 valfirst