Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot decorate AndroidDriver (probably the same for IOSDriver #1643

Closed
bhecquet opened this issue Feb 9, 2022 · 4 comments
Closed

Cannot decorate AndroidDriver (probably the same for IOSDriver #1643

bhecquet opened this issue Feb 9, 2022 · 4 comments
Labels

Comments

@bhecquet
Copy link

bhecquet commented Feb 9, 2022

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

@mykola-mokhnach
Copy link
Contributor

Yes, it makes sense to make these interfaces public. Please let us know if there are any other hidden ones that must be published

@bhecquet
Copy link
Author

bhecquet commented Feb 9, 2022

It seems that only HasAndroidSettings and HasIOSSettings are private

@mykola-mokhnach
Copy link
Contributor

The patch has been published. You could try the change by fetching the recent build from jitpack as described in https://github.com/appium/java-client#maven

@bhecquet
Copy link
Author

bhecquet commented Feb 9, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants