RE: Error while running the testng suite

Hi Guys,

I am trying to run a test suite which has two test cases and while running the test suite from eclipse i am getting the below error
Please advice.
Cannot find class in classpath: tests.LoginTest
at org.testng.xml.XmlClass.loadClass(
at org.testng.xml.XmlClass.init(
at org.testng.xml.XmlClass.<init>(
at org.testng.xml.TestNGContentHandler.startElement(
at Source)
at Source)
at Source)
at$ Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at$JAXPSAXParser.parse(Unknown Source)
at Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.testng.xml.XMLParser.parse(
at org.testng.xml.SuiteXmlParser.parse(
at org.testng.xml.SuiteXmlParser.parse(
at org.testng.xml.Parser.parse(
at org.testng.TestNG.initializeSuitesAndJarFile(
at org.testng.remote.RemoteTestNG.initAndRun(
at org.testng.remote.RemoteTestNG.main(

garlapati99 Default Asked on April 26, 2015 in Selenium WebDriver.
Add Comment
1 Answers

How are you running your test? If you are running it throw command line you have to include the path of the .class files using the  ‘-cp <Class file path> ‘ in your command line.


Professor Answered on April 27, 2015.

can u please explain this command

java -cp bin;libs/* org.testng.TestNG <path to testng.xml>

bin means the .class file of classes I want to execute
what libs means here
what org.testng.TestNG
where I will specify my testNG.jar path

on April 28, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.