[英]java.lang.AbstractMethodError: Receiver class io.cucumber.testng
I am getting "java.lang.AbstractMethodError: Receiver class io.cucumber.testng" When I try to runrunner class in selenium cucumber automation.当我尝试在 selenium cucumber 自动化中运行runner 类时,我收到“java.lang.AbstractMethodError: Receiver class io.cucumber.testng”。
Please find below pom.xml:请在 pom.xml 下方找到:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>seleniumMaster</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>16</source>
<target>16</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>7.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-testng -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-testng</artifactId>
<version>7.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
</dependencies>
</project>
Please help me to resolve this请帮我解决这个问题
Thanks in advance提前致谢
The dependencies in your pom are consistent.你的 pom 中的依赖是一致的。 However you are using Intellij IDEA which does not automatically reload the project after making changes to the pom file.
但是,您使用的是 Intellij IDEA,它在更改 pom 文件后不会自动重新加载项目。
You may have to reimport tbe project.您可能必须重新导入 tbe 项目。 There should be a button for that in the Maven drawer.
在 Maven 抽屉中应该有一个按钮。
And for future questions, do pay attention to How to Ask .对于以后的问题,请注意如何提问。 Screenshots are almost impossible to read.
屏幕截图几乎无法阅读。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.