【发布时间】:2017-02-18 05:41:50
【问题描述】:
通过批处理文件或命令行运行 testng.xml 时出现错误。 错误:无法找到或加载主类 org.testng.TestNG。 批处理文件详情如下:
set projectLocation=C:\GitRapo\MyProject
cd C:\GitRapo\MyProject
set classpath=C:\GitRapo\MyProject\bin;C:\GitRapo\MyProject\lib\*
java org.testng.TestNG C:\GitRapo\MyProject\testng.xml
pause
【问题讨论】:
-
你用IntelliJ正常运行吗?
-
你是如何导入库的?
-
我正在使用 Eclipse 中的构建路径部分将外部依赖项添加到我的项目中。我的项目在 eclipse 中,所有的 jars 都被添加到其中。
-
@Grzegorz Górkiewicz 通常在 Eclipse 中将它作为 testNG 运行,这工作正常。
标签: xml batch-file jenkins testng