Error executing testng.xml through CLI : Could not find or load main class org.testng.TestNG

前端 未结 1 1991
粉色の甜心
粉色の甜心 2020-11-29 13:40

Before I get into it, I\'m a newbie with selenium and so on. I have looked up all the answers to this issue and still haven\'t been able to fix the problem. My %claspath% an

相关标签:
1条回答
  • 2020-11-29 14:17

    The simplest way to execute your testng.xml is as follows :

    • Get your Project Location from your IDE i.e. Eclipse, through Windows Explorer go to the Project Location and create a directory lib .
    • Dump all the libraries (Selenium jars, TestNG) in the lib directory.
    • From Project Directory, through CLI provide the following classpath:

      C:\Users\keating99\workspace\FdimTests>set classpath=C:\Users\keating99\workspace\FdimTests\bin;C:\Users\keating99\workspace\FdimTests\lib\*;
      
    • Now, execute testng.xml as follows :

      C:\Users\keating99\workspace\FdimTests>java org.testng.TestNG testng.xml
      
    • Observe the Testcase gets executed.

    0 讨论(0)
提交回复
热议问题