如何解决以下错误消息
org.openqa.selenium.MutableCapabilities.is(Ljava/lang/String;)Z :java.lang.AbstractMethodError在自动化项目中与Java (配置:客户端-组合-3.7.1-源,客户-组合-3.7.1,逗号ns-2.6,org.eclipse.jgit_4.5.0.201609210915-r,Selenium - firefox -驱动程序-3.0.0-beta1,selenium- Server -独立-3.7.1 firefox诉44)
我尝试过许多selenium服务器& selenium驱动程序的组合,但是我收到了其他错误
<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>只有我使用的这些代码行:
System.setProperty("webdriver.gecko.driver", "C:\\Users\\Aila\\Downloads\\geckodriver-v0.19.1-win32\\geckodriver.exe");
driver = new FirefoxDriver(); 发布于 2017-11-13 12:44:14
这个错误说明了一切:
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首先,确保您正在使用最新版本的所有二进制文件和jars (Selenium、GeckoDriver、Firefox )。
如果您想使用Maven:
mvn clean install test如果您想使用Selenium和TestNG而不使用Maven
selenium-server-standalone-3.7.1。发布于 2019-03-14 11:13:09
这个问题有两种解决办法:
打开Windows命令提示符并键入以下命令:
java -Dwebdriver.gecko.driver="C:\NewAutomationCICD\resource\chromedriver.exe“-jar C:\NewAutomationCICD\libs\selenium-server-standalone-2.42.2.jar
https://stackoverflow.com/questions/47247925
复制相似问题