通过commadline ubuntu运行TestNG不起作用

时间:2017-10-14 16:23:28

标签: selenium testng ubuntu-16.04

当试图在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

     

                               

1 个答案:

答案 0 :(得分:1)

我猜你可能会复制粘贴,因为-(连字符)被读作特殊字符。请输入-cp(连字符cp

再试一次