0
votes

Started getting issues running my testng tests on eclipse after updating plugin to 5.14.6.20110125_1620. I get error of this sort:

Launching AdvanceSearchToCheckoutPage has encountered a problem. Clicking dialog details say "internal error occurred during: "Launching AdvanceSearchToCheckoutPage". Cannot find class in classpath: sandy.selenium.testng.SearchToCheckoutNav.AdvanceSearchToCheckoutPage"

Note this test was running perfectly fine day before. How do I run my test? I right-click the test and select run as testng. Now i want to revert to my old plugin version and running into all kinds of issues

Where is cedric when he is needed?

heres the stacktrace

org.testng.TestNGException: Cannot find class in classpath: alibris.selenium.testng.SearchToCheckoutNav.AdvanceSearchToCheckoutPage at org.testng.xml.XmlClass.loadClass(XmlClass.java:72) at org.testng.xml.XmlClass.init(XmlClass.java:64) at org.testng.xml.XmlClass.(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.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:767) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363) 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)

2

2 Answers

0
votes

I'm never far.

The missing class seems to indicate this is not a TestNG issue. Is it running fine with an older version of the plug-in?

-1
votes
org.testng.TestNGException: Cannot find class in classpath: 

This line is telling you that eclipse doesnt know where to look to compile your code when your run it as testNG test case. There are multiple solution that can be done but the one that works for me most of the time is that you have to add your project to class path

  1. go to your testNG test case
  2. run as "Run configuration"
  3. In the class path section click on restore default entries
  4. if no project is added then added manualy by clicking on add project. seee screen shot

hope this image also helps Image