[TestNG] [ERROR]

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

Originally posted at: https://www.linkedin.com/feed/update/urn:li:activity:6389872247590490112/

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.

2 Answers

answered by (29 points)
selected by
0 votes
Best answer
From, Arunkumar Velusamy (https://www.linkedin.com/in/arunkumarvelusamy/)

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
+1 vote
saved the xml file in the folder containing the class file and it worked for me.

Related questions