Aila Bogasieru
Aila Bogasieru

Reputation: 11

How to fix: Error message in TestNG java.lang.AbstractMethodError: org.openqa.selenium.MutableCapabilities.is(Ljava/lang/String;)Z

How to solve the following error message

java.lang.AbstractMethodError: org.openqa.selenium.MutableCapabilities.is(Ljava/lang/String;)Z in automation project with Java, Selenium Server (having the configuration : client-combined-3.7.1-sources, client-combined-3.7.1, commo ns-lang-2.6, org.eclipse.jgit_4.5.0.201609210915-r, selenium-firefox-driver-3.0.0-beta1, selenium-server-standalone-3.7.1 firefox v. 44)

I have tried many combinations of selenium server & selenium Firefox driver but I was receiving other errors

<dependencies> 
  <dependency> 
    <groupId>org.testng</groupId> 
    <artifactId>testng</artifactId> 
    <version>6.8.8</version> 
    <scope>test</scope> 
  </dependency> 
  <dependency> 
    <groupId>org.seleniumhq.selenium</groupId> 
    <artifactId>selenium-java</artifactId> 
    <version>3.7.1</version> 
  </dependency> 
</dependencies>

Only these lines of code I am using:

System.setProperty("webdriver.gecko.driver", "C:\\Users\\Aila\\Downloads\\geckodriver-v0.19.1-win32\\geck‌​odriver.exe"); 
driver = new FirefoxDriver(); 

Upvotes: 1

Views: 4380

Answers (2)

undetected Selenium
undetected Selenium

Reputation: 193348

The error says it all:

java.lang.AbstractMethodError: org.openqa.selenium.MutableCapabilities.is(Ljava/lang/String;)Z in automation project with Java, Selenium Server (having the configuration : client-combined-3.7.1-sources, client-combined-3.7.1, commo ns-lang-2.6, org.eclipse.jgit_4.5.0.201609210915-r, selenium-firefox-driver-3.0.0-beta1, selenium-server-standalone-3.7.1

First of all ensure that you are using all the binaries and jars of latest version (Selenium, GeckoDriver, Firefox Browser).


If you want to use Maven :

  • Remove all the Selenium related jars which you have added manually from your project.
  • Use Selenium and TestNG related jars only through Maven Dependencies.
  • Clean the Project
  • Execute mvn clean install test

If you want to use Selenium and TestNG without Maven:

  • Remove all the Selenium related jars once and add only the selenium-server-standalone-3.7.1 within your project.
  • Clean the Project
  • Execute your @Test as TestNG Test or TestNG Suite

Upvotes: 0

Ritesh Toppo
Ritesh Toppo

Reputation: 333

There are two solution for this isssue:

  1. Adding correct version in Selenium project coz different version don't have same solution for my issue selenium-server-standalone-2.42.2.jar is correct.
  2. This one is optional just try, if any of solution of this issue is not resolve.

Open Windows Command Prompt and type the command below:
java -Dwebdriver.gecko.driver="C:\NewAutomationCICD\resource\chromedriver.exe" -jar C:\NewAutomationCICD\libs\selenium-server-standalone-2.42.2.jar

Upvotes: 0

Related Questions