我正在尝试使用TestNG和Cucumber创建一个Selenium项目。 当我尝试从Cucumber的Runner文件或TestNG XML文件执行测试用例时,出现以下错误:
Error: Unable to initialize main class org.testng.remote.RemoteTestNG
Caused by: java.lang.NoClassDefFoundError: org/testng/TestNGException
当我尝试从Cucumber Feature文件执行测试用例时,出现以下错误:
Error: Could not find or load main class cucumber.api.cli.Main
Caused by: java.lang.ClassNotFoundException: cucumber.api.cli.Main
RunnerClass:
@CucumberOptions(
features = {"src/test/resources/features/Administration/Export.feature"},
monochrome = true,
plugin = {"pretty","html:target/Destination"},
glue = {"valveAware.port.localhost.tests"}
)
public class ValveAwareRunnerTest extends AbstractTestNGCucumberTests{
}
TestNG XML:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
<test thread-count="5" name="Test">
<classes>
<class name="valveAware.port.localhost.runner.ValveAwareRunnerTest"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
VATestProject的
添加了
我无法确定问题的原因。