Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

[TestNG] [ERROR] Cannot find class in classpath: test.pack.TestClass

Solved 2 Answers 1461 Views
0 2
[TestNG] [ERROR]

Cannot find the class in the classpath: test.pack.TestClass

Originally posted at:

2 Answers

Best answer
From, Arunkumar Velusamy (

Reasons could be,

1. class file name given in testng.xml is invalid and you could see that classpath printed in error message is not matching with actual classpath

2. compiled classes are not available inside the project or inside the jar file. Classpath printed in error message would be correct in this case.
answered by (29 points)
selected by
saved the xml file in the folder containing the class file and it worked for me.
answered by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.