0

Please let me know how to run the testng through command line

When I run the following command

java org.testng.TestNG TestNG.xml    

Getting error as below

Error: Could not find or load main class org.testng.TestNG

which means do we have to compile before running the test?

4

1 に答える 1

-1

System の ClassPath に TestNG Jar の完全なパスを追加してください。そうすれば機能します。このような:

C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%JAVA_HOME%\bin;C: \Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files \Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\ IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\SourceGear\Common\DiffMerge\;C:\Users\105451\Downloads\Compressed\testng -6.8.7.jar

于 2016-12-26T07:01:02.253 に答える