0

Error is displayed when the Selenium web driver java program is executed in Command prompt.But the same is working properly with no error in Eclipse.

1.Available solutions are tried but the error remains the same.

2.Testng jar file is added to the lib folder and the path set in the cmd

3.I need to run the child class which is derived from parent class.Both parent class and child classes are in the same package

Error:

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

Please find the attached screenshot

Error

Commands:

F:>cd Workspace3\OTN_test_Automation `F:\Workspace3\OTN_test_Automation>java -cp F:\Workspace3\OTN_test_Automation\lib *;F:\Workspace3\OTN_test_Automation\bin org.testng.TestNG testng.xml Error: Could not find or load main class org.testng.TestNG

F:\Workspace3\OTN_test_Automation>java -cp F:\Workspace3\OTN_test_Automation\lib *;F:\Workspace3\OTN_test_Automation\bin org.testng.TestNG testng.xml Error: Could not find or load main class org.testng.TestNG`

TestBot00
  • 11
  • 2
  • Please post complete command you used and also screenshot is missing. Please post complete exception stack trace also – Tarun Lalwani Mar 14 '18 at 06:38
  • Please update such things in your question and not add those as comments. I have corrected the picture for you. Once updated please delete these comments to keep the question clean – Tarun Lalwani Mar 14 '18 at 06:41
  • Possible duplicate of [Error executing testng.xml through CLI : Could not find or load main class org.testng.TestNG](https://stackoverflow.com/questions/49149724/error-executing-testng-xml-through-cli-could-not-find-or-load-main-class-org-t) – undetected Selenium Mar 14 '18 at 07:04
  • @DebanjanB i tried the solution in the duplicate one.It's not working – TestBot00 Mar 14 '18 at 07:49

0 Answers0