Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jenkins 使用bat文件运行TestNG时出错_Jenkins_Selenium Webdriver_Testng - Fatal编程技术网

Jenkins 使用bat文件运行TestNG时出错

Jenkins 使用bat文件运行TestNG时出错,jenkins,selenium-webdriver,testng,Jenkins,Selenium Webdriver,Testng,为什么会出现此错误: 错误:无法找到或加载主类org.testng.testng 使用bat文件运行TestNG时发生?您必须使用-cp参数向TestNGjar提供classpath。也适用于其他依赖JAR,如selenium和测试类(项目) 请尝试以下命令: java -cp J:\temp\testng\*;J:\temp\workspace\TestNGExamples\bin;J:\automation\* org.testng.TestNG J:\temp\workspace\Test

为什么会出现此错误:

错误:无法找到或加载主类org.testng.testng


使用bat文件运行TestNG时发生?

您必须使用
-cp
参数向
TestNG
jar提供
classpath
。也适用于其他依赖JAR,如selenium和测试类(项目)

请尝试以下命令:

java -cp J:\temp\testng\*;J:\temp\workspace\TestNGExamples\bin;J:\automation\* org.testng.TestNG J:\temp\workspace\TestNGExamples\testng1.xml
注意:请根据您的计算机更新路径

对于
-cp
参数,给定

  • 测试罐
  • 测试类(项目bin目录)
  • 硒罐

  • 你从哪里得到这个错误?你想测试什么?如何测试?请提供更多信息以帮助您。可能的副本