Skip to content

cannot be cast to class io.appium.java_client.android.AndroidDriver while using EventFiringDecorator #1694

@ChinmayPandaZee

Description

@ChinmayPandaZee

Description

I'm trying to use the decorator mechanism provided by selenium 4.
But following the doc to decorate the android driver, I get the exception

java.lang.ClassCastException: class jdk.proxy2.$Proxy22 cannot be cast to class io.appium.java_client.android.AndroidDriver (jdk.proxy2.$Proxy22 is in module jdk.proxy2 of loader 'app'; io.appium.java_client.android.AndroidDriver is in unnamed module of loader 'app')

Environment

Java client build version or git revision if you use some snapshot: 8.0.0
Appium server version or git revision if you use some snapshot: 1.22.3
Desktop OS/version used to run Appium if necessary: Mac Monterey
Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: Appium.exe
Mobile platform/version under test: android
Real device or emulator/simulator: Both

Details

Please provide more details, if necessary.

Code To Reproduce Issue [ Good To Have ]

AndroidDriver driver = new AndroidDriver(url, driverCapabilities);
driver=(AndroidDriver) new EventFiringDecorator(new MyLIstner()).decorate(driver);

SImilar to Cannot decorate AndroidDriver (probably the same for IOSDriver #1643

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions