类的重复注释:接口org.testng.annotations。方法前

时间:2019-03-14 18:55:48

标签: java selenium testng

我是Selenium Java的新手。运行Java类时,它显示以下错误:

  

[RemoteTestNG]检测到TestNG版本6.14.3   java.lang.annotation.AnnotationFormatError:的重复注释   类:接口org.testng.annotations.BeforeMethod:   @ org.testng.annotations.BeforeMethod(inheritGroups = true,   DependerOnGroups = [],dependsOnMethods = [],firstTimeOnly = false,   groups = [],description =,alwaysRun = false,

Duplicate annotation是什么意思,我应该在哪里调试?

环境:Eclipse Neon,Mac,Maven项目,TestNg框架。

1 个答案:

答案 0 :(得分:0)

我刚刚想通了。 在“测试基础课程”之一中,我误打印了

@BeforeMethod标记两次,因此在运行java类时,它显示上述错误。 删除多余的@BeforeMethod标记即可解决此问题。