Skip to content

Cannot decorate AndroidDriver (probably the same for IOSDriver #1643

@bhecquet

Description

@bhecquet

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.IllegalStateException: Invisible interface type interface io.appium.java_client.android.HasAndroidSettings for class net.bytebuddy.renamed.java.lang.Object$ByteBuddy$Eik9i4kq

Full stacktrace is below

As I understand, this is due to the fact that HasAndroidSettings is not public

Environment

  • Java client build version or git revision if you use some snapshot: 8.0.0-beta2
  • Appium server version or git revision if you use some snapshot: 1.18.1
  • Desktop OS/version used to run Appium if necessary: Windows 10
  • 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: android simulator

Details

Code To Reproduce Issue [ Good To Have ]

UiAutomator2Options options = new UiAutomator2Options();
AndroidDriver mobileDriver = new AndroidDriver(new URL("http://appiumServer:4723/wd/hub"), options);
new EventFiringDecorator(new MyListener()).decorate(mobileDriver);

mobileDriver is correctly created, but applying decoration fails with the stacktrace

Exception Stacktraces

java.lang.IllegalStateException: Invisible interface type interface io.appium.java_client.android.HasAndroidSettings for class net.bytebuddy.renamed.java.lang.Object$ByteBuddy$Eik9i4kq
	at net.bytebuddy.dynamic.scaffold.InstrumentedType$Default.validated(InstrumentedType.java:1222)
	at net.bytebuddy.dynamic.scaffold.MethodRegistry$Default.prepare(MethodRegistry.java:519)
	at net.bytebuddy.dynamic.scaffold.subclass.SubclassDynamicTypeBuilder.make(SubclassDynamicTypeBuilder.java:207)
	at net.bytebuddy.dynamic.scaffold.subclass.SubclassDynamicTypeBuilder.make(SubclassDynamicTypeBuilder.java:198)
	at net.bytebuddy.dynamic.DynamicType$Builder$AbstractBase.make(DynamicType.java:3404)
	at net.bytebuddy.dynamic.DynamicType$Builder$AbstractBase$Delegator.make(DynamicType.java:3600)
	at org.openqa.selenium.support.decorators.WebDriverDecorator.createProxy(WebDriverDecorator.java:323)
	at org.openqa.selenium.support.decorators.WebDriverDecorator.decorate(WebDriverDecorator.java:190)

Link To Appium Logs

Appium logs are not relevant as the problem resides in java_client

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions