Org.testng.TestNGException: while trying to run tests

I have been working on a project for a long time using Android Studio. Today, some code was reorganized, and it began to break, so the changes were returned. Even after fixing the changes, whenever I try to debug the code, I get the following exception:

org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 44; Attribute "parallel" with value "none" must have a value from the list "false methods tests classes instances ". at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:325) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:90) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:206) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:177) at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:125) Caused by: org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 44; Attribute "parallel" with value "none" must have a value from the list "false methods tests classes instances ". at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.validateDTDattribute(XMLDTDValidator.java:1392) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(XMLDTDValidator.java:1311) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1917) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:742) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:380) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:614) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3135) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:880) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777) 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.XMLParser.parse(XMLParser.java:39) at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:16) at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:9) at org.testng.xml.Parser.parse(Parser.java:172) at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:305) ... 4 more 

trying to open a project using intelliJ . I can leave this. Any clues about this?

+7
source share
6 answers

The discussion and help from @juherr suggests that the solution to this is:

 Attribute "parallel" with value "none" must have a value from the list "false methods tests classes instances ". 

TestNG 6.9.10 now checks the xml file for DTD. The problem is that the default testng.xml template from IntelliJ sets "parallel" to the "none" set. Below is the error link for this.

+3
source

update testng.xml to

 <suite name="Suite" parallel="false"> 

from

 <suite name="Suite" parallel="none"> 
+2
source

If you don't have an editable testng.xml file, you can reduce your testng dependency to 6.9.9.

0
source

If you use / implement any listener in your class / project, then add the @Listeners annotation for this class, like @Listeners below:

 @Listeners(value=SuiteListener.class) 

eg

 @Listeners(value=ClassName who implemets listener.class) 

eg

 @Listeners(value=SuiteListener.class) public class SuiteListener implements ISuiteListener { lines of code / methods in class } 

Add below code snippet to testng.xml

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Suite"> <listeners> <listener class-name="report.SuiteListener"></listener> </listeners> <test thread-count="5" name="Test"> <classes> <class name="tests.Test1"/> <class name="tests.Test2"/> </classes> </test> <!-- Test --> </suite> <!-- Suite --> 
0
source

Please downgrade your version of TestNG, for me it works with version 6.8.8.

0
source

Faced the same problem and the same exception. Worked for me by deleting

 {parallel="none"} 

or giving meaning

 {parallel="false"} 

in the testng.xml file. After working fine.

-1
source

All Articles