question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with AppiumLocalDriverService when repo has dependencies on both Appium and Selenium 4

See original GitHub issue

Description

Given the dependency on both selenium 4 and appium, when I try to build a DriverService object for AppiumDriver, the operation fails with the below exception :

java.lang.AbstractMethodError: Receiver class io.appium.java_client.service.local.AppiumServiceBuilder does not define or inherit an implementation of the resolved method abstract createArgs()Ljava/util/List; of abstract class org.openqa.selenium.remote.service.DriverService$Builder.

Environment

  • Java client build version or git revision if you use some snapshot: io.appium:java-client:7.3.0
  • Appium server version or git revision if you use some snapshot: NA
  • Desktop OS/version used to run Appium if necessary: NA
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: NA
  • Mobile platform/version under test: NA
  • Real device or emulator/simulator: NA

Details

Noticed that this issue is occurring due to a conflict of Selenium 4 and Appium. The abstract Builder class has now an extra argument for duration. The same code works fine when I downgrade the selenium version to 3.141.59

Code To Reproduce Issue [ Good To Have ]

In the build.gradle file :

dependencies {
    api 'io.appium:java-client:7.3.0',
    api 'org.seleniumhq.selenium:selenium-java:4.0.0-alpha-6'
}

public static void main(String[] args) {
        AppiumDriverLocalService iOSDriverService;
        String appiumDriverPath = "/usr/local/bin/appium";
        String nodeJSDriverPath = "/usr/local/bin/node";

        iOSDriverService = new AppiumServiceBuilder()
                .usingDriverExecutable(new File(nodeJSDriverPath))
                .withAppiumJS(new File(appiumDriverPath))
                .withIPAddress("0.0.0.0")
                .usingAnyFreePort()
                .withArgument(GeneralServerFlag.SESSION_OVERRIDE)
                .withArgument(GeneralServerFlag.LOG_LEVEL,"error")
                .build();
        iOSDriverService.start();

        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,"iOS");
        capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION,"13.2");
        capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,"iPhone 11 Pro Max");
        capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME,"XCUITest");
        capabilities.setCapability(MobileCapabilityType.BROWSER_NAME,"Safari");

        AppiumDriver<MobileElement> ios = new IOSDriver<>(iOSDriverService, capabilities);

        ios.get("https://www.google.com");

    }

Exception Stacktraces

https://gist.github.com/rookieInTraining/4c43f3888f3e088d8ae78195a0a4f641

Link To Appium Logs

NA

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
valfirstcommented, Nov 4, 2021

java-client: 7.6.0

Selenium 4 is supported starting from 8.0.0-beta version.

1reaction
mykola-mokhnachcommented, Jun 16, 2020

The error is expected. java client is not compatible to selenium4

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to start appium service by AppiumDriverLocalSerivce
Hi Guys, Now i am trying to use page object model to design my selenium + appium framework. I wan to start the...
Read more >
How Gradle decides from which dependency to take class if it ...
In this case Appium did a bad job including Selenium classes instead of declaring a transitive dependency. You should not use both ......
Read more >
Introducing TestProjects unified OpenSDK for Java - YouTube
In this video we will discuss an complete introduction to TestProjects new unified OpenSDK. Using this SDK, one can write native Selenium ......
Read more >
Setting Appium-Maven project with Java client dependencies
appium #java #mobileautomation▭▭▭▭▭▭ In this Video ... Appium -Part 4 : Setting Appium -Maven project with Java client dependencies.
Read more >
Released Selenide 6.0.1 Upgrade to Selenium 4
It's hard to believe, but today Selenide got … 10 years old! This day 10 years ago was created the first commit to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found