1
votes

I am having maven project with testng files in src/test folder. When I run the Maven install commend I see all testng are running. But while I am trying to run one testng file individually as run as --> Testng Test. I am getting below exception.

org.testng.TestNGException: Cannot find class in classpath: HelloClass

I am able to generate testng class files and saved under target/test-classes folder using maven build option.

1
Can you please add more details ? Perhaps a screenshot of what you are doing, what does your suite xml file look like etc.,Krishnan Mahadevan
It seems that you are not created a package, You're running the testNG with default package. I would highly suggested you to create a package and start execute the program with testNG. It will surely work.Srihari

1 Answers

-2
votes

Try move all your test classes from src/test/java into src/main/java