Skip to content

java.lang.ClassCastException: class org.openqa.selenium.Platform$23 cannot be cast to class java.lang.String (org.openqa.selenium.Platform$23 is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap') #1701

Closed
@n00bstr

Description

@n00bstr

Description

Unable to create both IOSDriver and AndroidDriver after upgrading Selenium to 4.2.0 and Appium to 8.1.0. Error message displayed below:

Where creating iOSDriver:

java.lang.ClassCastException: class org.openqa.selenium.Platform$23 cannot be cast to class java.lang.String (org.openqa.selenium.Platform$23 is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')

	at io.appium.java_client.AppiumDriver.ensurePlatformName(AppiumDriver.java:136)
	at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:105)

When creating AndroidDriver:

java.lang.ClassCastException: class org.openqa.selenium.Platform$22 cannot be cast to class java.lang.String (org.openqa.selenium.Platform$22 is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')

	at io.appium.java_client.AppiumDriver.ensurePlatformName(AppiumDriver.java:136)
	at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:116)

Notes

  • iOSDriver created with Xcuitestoptions
  • AndroidDriver created with both DesiredCapabilities and UiAutomator2Options
  • Both methods results in the same cannot cast error message above

Environment

  • Java client build version or git revision if you use some snapshot: 8.1.0
  • Appium server version or git revision if you use some snapshot: 2.0.0-beta.24
  • Desktop OS/version used to run Appium if necessary: MacOS Monterey
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe:
  • Mobile platform/version under test: iOS/Android
  • Real device or emulator/simulator: emulator/simulator

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