This error message…
java.lang.AbstractMethodError: org.openqa.selenium.remote.service.DriverService$Builder.createArgs()Lcom/google/common/collect/ImmutableList;
…implies that there is some incompatibility between the version of the binaries you are using specifically with the guava dependency.
- You are using chrome= 76.0
-
You are using the following:
<dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-chrome-driver</artifactId> <version>3.5.3</version> <scope>test</scope> </dependency>
-
Your Selenium Client version is 3.5.3 which is more then 2 years older.
- Your JDK version is unknown to us.
So there is a clear mismatch between the Selenium Client v3.5.3 and Chrome Browser v76.0
However as per the discussions in:
- java.lang.NoSuchMethodError: com.google.common.collect.ImmutableList.builderWithExpectedSize
- NoSuchMethodError: com.google.common.collect.ImmutableList.toImmutableList()Ljava/util/stream/Collector; after upgrade to 2.0.16
These issues crop up due to incompatibile Guava dependency.
The current guava version used within
selenium-java-3.141.59
is guava-25.0-jre
Solution
Ensure that:
- JDK is upgraded to current levels JDK 8u222.
- Selenium is upgraded to current levels Version 3.141.59.
- Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
- If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
- Take a System Reboot.
- Execute your
@Test
as non-root user. - Always invoke
driver.quit()
withintearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully.
Update
So presumably your main question with respect to the error:
java.lang.AbstractMethodError: org.openqa.selenium.remote.service.DriverService$Builder.createArgs()Lcom/google/common/collect/ImmutableList;
is solved. Congratulations.
Now, as per your question update as you are seeing the error:
java.lang.NoClassDefFoundError: org/apache/http/auth/Credentials
There are two aspects.
- NoClassDefFoundError: NoClassDefFoundError in Java occurs when Java Virtual Machine is not able to find a particular class at runtime which was available at compile time. You can find a detailed discussion in Exception in thread “main” java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver
http/auth
: Traces of http/auth implieshttp client
is still in use where as the CHANGELOG reflects:- The
HttpClient
implementation details were out ofHttpCommandExecutor
right from Selenium v2.45.0. - With the availability of Selenium v3.11, Selenium Grid was switched to use
OkHttp
rather than theApache HttpClient
. - Further with the release of Selenium v3.141.0,
Apache HttpClient
was removed fromselenium-server-standalone
which drastically
reduced the size of selenium server distribution package. - Even the
apache-backed httpclient
was also removed. - You can find a detailed discussion in org.openqa.selenium.remote.internal.ApacheHttpClient is deprecated in selenium 3.14.0 – What should be used instead?
- The