Unable to run tests from Eclipse

4,370 views
Skip to first unread message

coolgoose

unread,
Jan 29, 2011, 1:41:26 PM1/29/11
to testng...@googlegroups.com
Hi,

I am not able to run/debug any of my tests in Eclipse. If you were able to overcome this issue, can you help please? Not sure what is the mistake I am doing.
Am getting the following error:

Message: An internal error occurred during: "Launching BuildAcceptanceTests".

Exception Stack Trace:
org.testng.TestNGException:
Cannot find class in classpath: packageName.BuildAcceptanceTests
at org.testng.xml.XmlClass.loadClass(XmlClass.java:72)
at org.testng.xml.XmlClass.init(XmlClass.java:64)
at org.testng.xml.XmlClass.<init>(XmlClass.java:50)
at org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:503)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:788)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:198)
at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:17)
at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:10)
at org.testng.xml.Parser.parse(Parser.java:153)
at org.testng.eclipse.util.CustomSuite.createXmlFileFromTemplate(CustomSuite.java:150)
at org.testng.eclipse.util.CustomSuite.createContentBuffer(CustomSuite.java:105)
at org.testng.eclipse.util.CustomSuite.getSuiteBuffer(CustomSuite.java:222)
at org.testng.eclipse.util.CustomSuite.save(CustomSuite.java:241)
at org.testng.eclipse.launch.TestNGLaunchConfigurationDelegate.createVMRunner(TestNGLaunchConfigurationDelegate.java:238)
at org.testng.eclipse.launch.TestNGLaunchConfigurationDelegate.launchTypes(TestNGLaunchConfigurationDelegate.java:109)
at org.testng.eclipse.launch.TestNGLaunchConfigurationDelegate.launch(TestNGLaunchConfigurationDelegate.java:67)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:923)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1126)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Session Data:
eclipse.buildId=M20100909-0800
java.version=1.6.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_IN
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product

Cédric Beust ♔

unread,
Jan 29, 2011, 3:22:40 PM1/29/11
to testng...@googlegroups.com
Here is the error:


On Sat, Jan 29, 2011 at 10:41 AM, coolgoose <dinesh.r...@gmail.com> wrote:
Cannot find class in classpath: packageName.BuildAcceptanceTests

Is the spelling in your testng.xml correct? How about your classpath?

--
Cédric


coolgoose

unread,
Jan 29, 2011, 4:22:34 PM1/29/11
to testng...@googlegroups.com
The name is correct. I checked the classpath too. Is any manual correction required in the .classpath file?

Cédric Beust ♔

unread,
Jan 29, 2011, 4:30:00 PM1/29/11
to testng...@googlegroups.com
No, you don't need to touch .classpath.

For some reason, TestNG can't find your class. Can you load this type Ctrl-Shift-t? This is a good way to verify that it's on your classpath.

-- 
Cédric


On Sat, Jan 29, 2011 at 1:22 PM, coolgoose <dinesh.r...@gmail.com> wrote:
The name is correct. I checked the classpath too. Is any manual correction required in the .classpath file?

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.



--
Cédric


coolgoose

unread,
Jan 29, 2011, 4:36:26 PM1/29/11
to testng...@googlegroups.com
Did that. :(
 If I type TestNG or my class i.e. BuildAcceptanceTests, the files are getting displayed.

coolgoose

unread,
Jan 30, 2011, 4:53:35 AM1/30/11
to testng...@googlegroups.com
I deleted my project from Eclipse and created the project again and it worked.
Reply all
Reply to author
Forward
0 new messages