appium / appium/java-client

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
#1,859 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

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')"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Maven dependencies in pom and the AndroidTouchAction call, then trace how the driver is created and passed to this cast. Reproduce the ClassCastException with the supplied Selenium and Appium versions and verify that drag-and-drop works on an Android browser without the reported failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.