0

While running Selenium TestNG maven project from command prompt, I am getting this error:

Unable to initialize main class org.testng.TestNG

I am using command as below:

java -cp C:\Users\Sonali\eclipse-workspace\FacebookLoginTestNG\lib\*;C:\Users\Sonali\eclipse-workspace\FacebookLoginTestNG\src\test\java\com\mycomapny\fbauto org.testng.TestNG testng.xml

I guess running a maven project is tricky. As the lib folder is not getting created in maven project, I have created it manually.

How can I solve this?

Ralf
  • 16,086
  • 4
  • 44
  • 68
Sonali
  • 1
  • did u try this one -https://stackoverflow.com/questions/17894938/getting-error-could-not-find-or-load-main-class-org-testng-testng – NarendraR Aug 13 '18 at 11:46
  • Does this address your issue https://stackoverflow.com/questions/49149724/error-executing-testng-xml-through-cli-could-not-find-or-load-main-class-org-t – undetected Selenium Aug 13 '18 at 11:59
  • Yes, I have tried both the approaches however no luck yet. – Sonali Aug 16 '18 at 13:46

0 Answers0