Issue with AppiumLocalDriverService when repo has dependencies on both Appium and Selenium 4
See original GitHub issueDescription
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:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Selenium 4 is supported starting from
8.0.0-beta
version.The error is expected. java client is not compatible to selenium4