Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
11.5k views
by Contributing Tester (29 points)
edited by
[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/

2 Answers

0 like 0 dislike
by Contributing Tester (29 points)
selected by
 
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.
1 like 0 dislike
by
saved the xml file in the folder containing the class file and it worked for me.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...