TestNG 错误

编程入门 行业动态 更新时间:2024-10-07 21:35:30
本文介绍了TestNG 错误-java.lang.NoSuchMethodError: org.testng.TestRunner.addListener(Ljava/lang/Object;)V的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我安装的 testNG 版本是 (6.9.11).我的 pom .xml 有 (6.14.3).Eclipse 版本 neon 4.6.3

I have installed testNG version is (6.9.11).My pom .xml has (6.14.3).Eclipse version neon 4.6.3

当我通过 TestNG 运行课程时出现以下错误.有人可以帮我吗?

I am getting the below error when I run the class through TestNG.Can anyone please help me on this ?

java.lang.NoSuchMethodError: org.testng.TestRunner.addListener(Ljava/lang/Object;)V
    at org.testng.remote.support.RemoteTestNG6_9_10$1.newTestRunner(RemoteTestNG6_9_10.java:32)
    at org.testng.remote.support.RemoteTestNG6_9_10$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG6_9_10.java:61)
    at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:713)
    at org.testng.SuiteRunner.init(SuiteRunner.java:260)
    at org.testng.SuiteRunner.<init>(SuiteRunner.java:198)
    at org.testng.TestNG.createSuiteRunner(TestNG.java:1295)
    at org.testng.TestNG.createSuiteRunners(TestNG.java:1273)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1128)
    at org.testng.TestNG.runSuites(TestNG.java:1049)
    at org.testng.TestNG.run(TestNG.java:1017)
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:137)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:58)

推荐答案

试试这个.

将 TestNG 库添加到项目中.

Adding the TestNG Library into the project.

右键单击项目

Right Click on the Project

构建路径

配置构建路径

库(标签页)

转到添加库"并点击按钮.

Go to "Add Library" and click the button.

添加TestNG"库,然后单击确定"/下一步".

Add the 'TestNG' Library and click Ok/Next.

TestNG 库将添加到您的项目中.

TestNG Library will be added to your project.

重启项目

这篇关于TestNG 错误-java.lang.NoSuchMethodError: org.testng.TestRunner.addListener(Ljava/lang/Object;)V的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 22:09:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1400884.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   TestNG

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!