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

Jenkins 错误:无法找到或加载主类org.testng.testng,jenkins,selenium-webdriver,testng,Jenkins,Selenium Webdriver,Testng,错误:无法找到或加载主类org.testng.testng 我使用以下步骤/命令通过命令提示符运行testNG脚本: 1. in my project folder, create a lib folder and copy all the jar files 2. open cmd --> cd myProjectDirectoryPath 3. set classpath=myProjectDirectoryPath/bin 4. set classpath=myProjectDire

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

我使用以下步骤/命令通过命令提示符运行testNG脚本:

1. in my project folder, create a lib folder and copy all the jar files
2. open cmd --> cd myProjectDirectoryPath
3. set classpath=myProjectDirectoryPath/bin
4. set classpath=myProjectDirectoryPath/lib/*
5. java org.testNG.TestNG testng.xml
但在此之后,我无法找到或加载主类org.testng.testng
错误。已尝试调试,但仍不成功。有人能帮我吗。

至少尝试添加到
classpath

set classpath=myProjectDirectoryPath/bin
set classpath=%classpath%;myProjectDirectoryPath/lib/*
如果不是,则第二个“
设置”
”将覆盖第一个

Of直接在java命令中指定cp(类路径):

java -cp myProjectDirectoryPath/bin;myProjectDirectoryPath/lib/* org.testng.TestNG testng.xml
在这两种情况下,确保在其中一个文件夹中有一个
testng.jar