我已经使用 TestNG 编写了一个测试套件。我只为我的服务包含了一个 test.java 文件。我也创建了 testng.xml 文件。当我运行 testng.xml 文件时,出现以下错误:
Error: Could not find or load main class org.testng.remote.RemoteTestNG
请告诉我如何解决这个问题。使用 this 创建测试套件关联。我使用 this 运行套件链接。
编辑: 我的 testng.xml 看起来像:
<suite name="TestAll">
<test name="testService">
<classes>
<class name="com.ui.business.service.impl.myservice.test.MyServiceTest"/>
</classes>
</test>
</suite>
我将 testng.xml 保存在根文件夹中。该项目使用 Maven 编译。我的服务类在 com.ui.business.service.impl.myservice 包中。当我使用“TestNG Suite”运行 testng.xml 时,出现此错误。请建议如何解决此类路径问题。
最佳答案
这对我有用:
- 右键单击您的项目
- 点击
属性
- 点击
TestNG
- 取消选中
Use Project TestNG jar
框 - 点击
应用并关闭
关于java - 错误 : Could not find or load main class org. testng.remote.RemoteTestNG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32943504/