Maven 如何修复:TestNG java.lang.AbstractMethodError中的错误消息:org.openqa.selenium.MutableCapabilities.is(Ljava/lang/String;)Z
如何解决以下错误消息 java.lang.AbstractMethodError: org.openqa.selenium.MutableCapabilities.is(Ljava/lang/String;)Z in 带有Java、Selenium服务器的自动化项目(具有 配置: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) 我尝试了许多selenium服务器和selenium Firefox驱动程序的组合,但我收到了其他错误Maven 如何修复:TestNG java.lang.AbstractMethodError中的错误消息:org.openqa.selenium.MutableCapabilities.is(Ljava/lang/String;)Z,maven,selenium,selenium-firefoxdriver,selenium-server,Maven,Selenium,Selenium Firefoxdriver,Selenium Server,如何解决以下错误消息 java.lang.AbstractMethodError: org.openqa.selenium.MutableCapabilities.is(Ljava/lang/String;)Z in 带有Java、Selenium服务器的自动化项目(具有 配置:client-combined-3.7.1-sources,client-combined-3.7.1, commo ns-lang-2.6,org.eclipse.jgit_4.5.0.201609210915-r,
<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>
错误说明了一切:
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
首先,确保您使用的是最新版本的所有二进制文件和JAR(Selenium
,GeckoDriver
,Firefox浏览器
)
如果您想使用Maven:
- 从
项目中删除手动添加的所有
相关罐子Selenium
- 只能通过
Maven依赖项使用
和Selenium
相关jarTestNG
项目清洁
- 执行maven清洁安装测试
- 一次性移除所有
相关JAR,并仅在Selenium
项目中添加
Selenium-server-standalone-3.7.1
项目清洁
- 执行
作为测试
或TestNG测试
TestNG套件
- 错误说明了一切:
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
首先,确保您使用的是最新版本的所有二进制文件和JAR(Selenium
,GeckoDriver
,Firefox浏览器
)
如果您想使用Maven:
- 从
项目中删除手动添加的所有
相关罐子Selenium
- 只能通过
Maven依赖项使用
和Selenium
相关jarTestNG
项目清洁
- 执行maven清洁安装测试
- 一次性移除所有
相关JAR,并仅在Selenium
项目中添加
Selenium-server-standalone-3.7.1
项目清洁
- 执行
作为测试
或TestNG测试
TestNG套件
java-Dwebdriver.gecko.driver=“C:\NewAutomationCICD\resource\chromedriver.exe”-jar C:\NewAutomationCICD\libs\selenium-server-standalone-2.42.2.jar此问题有两种解决方案:
java-Dwebdriver.gecko.driver=“C:\NewAutomationCICD\resource\chromedriver.exe”-jar C:\NewAutomationCICD\libs\selenium-server-standalone-2.42.2.jar您能在问题中显示项目maven配置的XML吗?尤其是
依赖项
部分。org.testng testng 6.8.8 test org.seleniumhq.selenium selenium java 3.7.1无论如何,我不是从pom文件运行测试,我只是使用Run-as TestNGYou从2016年9月开始使用selenium-firefox-driver-3.0.0-beta
,虽然nevest版本是:谢谢你的回复,我添加了它,但我有相同的错误。你能在问题中显示项目maven配置的XML吗?尤其是依赖项
部分。org.testng testng 6.8.8 test org.seleniumhq.selenium selenium java 3.7.1无论如何,我不是从pom文件运行测试,我只是使用Run-as TestNGYou从2016年9月开始使用selenium-firefox-driver-3.0.0-beta
,最新的版本是:谢谢你的回复,我添加了它,但我有同样的错误。谢谢你的回答,但似乎我做的每件事都面临着同样的错误。我有以下JAR:selenium 3.7.1、webdriver 1.6.2、testng 11.6。我做了清洁项目,mvn清洁安装测试;仍然显示了相同的错误现在我面临另一个错误,在classpath中找不到类:Tests.CreateDeviceTest在org.testng.xml.XmlClass.loadClass(XmlClass.java:81)在org.testng.xml.XmlClass.init(XmlClass.java:73)在org.testng.xml.XmlClass。