简体   繁体   English

TestNG 异常 - org.testng.TestNGException:在类路径中找不到类:

[英]TestNG Exception - org.testng.TestNGException: Cannot find class in classpath:

I have included all the required jars and cleaned the project.我已经包含了所有必需的罐子并清理了项目。 (I'm using eclipse IDE) It was working two days back, but doesn't seem to work now. (我正在使用 Eclipse IDE)两天前它正在工作,但现在似乎不起作用。 Note : Two days back, it was a maven project, now it's a normal java project...注意:两天前,它是一个maven项目,现在它是一个普通的java项目......

Still throws this error :仍然抛出这个错误:

[RemoteTestNG] detected TestNG version 6.8.2
org.testng.TestNGException: 
Cannot find class in classpath: PutAway
    at org.testng.xml.XmlClass.loadClass(XmlClass.java:81)
    at org.testng.xml.XmlClass.init(XmlClass.java:73)
    at org.testng.xml.XmlClass.<init>(XmlClass.java:59)
    at org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:543)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
    at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:745)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
    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:172)
    at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:311)
    at org.testng.remote.AbstractRemoteTestNG.initialize(AbstractRemoteTestNG.java:137)
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:98)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

Mostly you need to add TestNG library to project to run testng in eclipse.大多数情况下,您需要将 TestNG 库添加到项目中才能在 Eclipse 中运行 testng。 For maven it will take jars as per pom.xml对于 maven,它将按照 pom.xml 使用 jars

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:org.testng.TestNGException:在类路径中找不到类:EmpClass - Error: org.testng.TestNGException: Cannot find class in classpath: EmpClass org.testng.TestNGException在类路径中找不到类 - org.testng.TestNGException Cannot find class in classpath org.testng.TestNGException:在类路径中找不到类:testcases.Guru99TestCase1 - org.testng.TestNGException: Cannot find class in classpath: testcases.Guru99TestCase1 org.testng.TestNGException:无法实例化类 - org.testng.TestNGException: Cannot instantiate class org.testng.TestNGException:无法实例化类 - org.testng.TestNGException : Cannot instantiate class Getting org.testng.TestNGException: Cannot find class in classpath: error in eclipse during running my program through testng.xml - Getting org.testng.TestNGException: Cannot find class in classpath: error in eclipse during running my program through testng.xml org.testng.TestNGException:无法实例化com.Testform类 - org.testng.TestNGException: Cannot instantiate class com.Testform org.testng.TestNGException:无法实例化 class test.AddCustomerTest - org.testng.TestNGException: Cannot instantiate class test.AddCustomerTest 我在线程“main”org.testng.TestNGException 中收到错误异常:运行测试时无法从文件加载 class - I am getting error Exception in thread "main" org.testng.TestNGException: Cannot load class from file while running a test org.testng.TestNGException:无法实例化黄瓜测试运行器 - org.testng.TestNGException: Cannot instantiate cucumber test runner
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM