运行 TestNG 通过命令行 ubuntu 不工作
Running TestNG through commadline ubuntu not working
当试图通过 ubuntu 中的命令行 运行 testNg 时,它会抛出
java –cp "bin:/home/john/selenium-lib/*" org.testng.TestNG src/testing.xml
Error: Could not find or load main class –cp
src/TestCase */
封装测试;
import org.testng.annotations.Test;
public class TestCase {
String message = "Hello World";
@Test
public void testPrintMessage() {
System.out.println("Invoked testString " + message);
}
}
src/testing.xml
我猜您可能复制粘贴了,因为 -
(连字符)被读取为特殊字符 –
。请输入 -cp
(连字符 cp
)
再试一次
当试图通过 ubuntu 中的命令行 运行 testNg 时,它会抛出
java –cp "bin:/home/john/selenium-lib/*" org.testng.TestNG src/testing.xml
Error: Could not find or load main class –cp
src/TestCase */
封装测试;
import org.testng.annotations.Test; public class TestCase { String message = "Hello World"; @Test public void testPrintMessage() { System.out.println("Invoked testString " + message); } }
src/testing.xml
我猜您可能复制粘贴了,因为 -
(连字符)被读取为特殊字符 –
。请输入 -cp
(连字符 cp
)