java - 类的重复注释:接口 org.testng.annotations。之前方法
问题描述
我是 Selenium Java 的新手。运行 java 类时,它显示以下错误:
[RemoteTestNG] 检测到 TestNG 版本 6.14.3 java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: interface org.testng.annotations.BeforeMethod: @org.testng.annotations.BeforeMethod(inheritGroups=true, dependsOnGroups=[], dependsOnMethods =[],firstTimeOnly=false,groups=[],description=,alwaysRun=false,
什么Duplicate annotation
意思,我应该在哪里调试?
环境:Eclipse Neon、Mac、Maven 项目、TestNg 框架。
解决方案
我刚刚想通了。在我错误打印的“测试基类”之一中
@BeforeMethod 标记两次,因此在运行 java 类时,它会显示上述错误。删除额外的@BeforeMethod 标签,解决了这个问题。
推荐阅读
- ios - 如何以最少的重新压缩将新创建的 AVMutableComposition 写入磁盘?
- node.js - 如何显示所选ID中的图像
- c# - 长值的 C# BIG Endian 格式
- android - MapActivity 安卓工作室
- java - L-world 价值类型(来自项目 valhalla)在实践中是无用的吗?
- google-maps - 每当我使用谷歌地图 API 密钥时,它都不起作用
- php - 如何在源文件夹中删除数据库中的图像
- amazon-web-services - 连接 S3 - Lambda - EC2 - Elasticsearch
- dart - 新路线 [webview] 未全高显示
- mysql - 如何在一个 sql 查询中按两个值作为 desc 排序?