<parameters> tag not accepted in testng.xml after updating from TestNG 6.8 to 6.11 version.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

<parameters> tag not accepted in testng.xml after updating from TestNG 6.8 to 6.11 version.

akshay.maldhure
My suite file looks something like this:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" [<!ENTITY parent SYSTEM "src/test/resources/base_params.xml">]> <suite name="MyTestSuite" verbose="1"> <parameters>&parent;</parameters> <listeners> <listener class-name="listener.ListenerClass" /> </listeners> <test name="Some Test"> <classes> <class name="test.Test" /> </classes> </test> </suite>

This worked perfectly fine till I was on TestNG 6.8 version, but soon after updating to TestNG 6.11 version, I get error "Element type "parameters" must be declared" on trying to run tests in this XML file.

I checked a related post on StackOverflow (https://stackoverflow.com/questions/43220066/testng-6-10-issue-with-parameters-tag-in-xml), but it did not help.

Here's the full error log.

[ERROR] org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 16; Element type "parameters" must be declared
[ERROR] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:324)
[ERROR] at org.testng.TestNG.run(TestNG.java:1101)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
[ERROR] Caused by: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 16; Element type "parameters" must be declared.
[ERROR] at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
[ERROR] at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
[ERROR] at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1906)
[ERROR] at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:742)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
[ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
[ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
[ERROR] at javax.xml.parsers.SAXParser.parse(SAXParser.java:195
[ERROR] at org.testng.xml.XMLParser.parse(XMLParser.java:39)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:16)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:9)
[ERROR] at org.testng.xml.Parser.parse(Parser.java:170)
[ERROR] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:304)
[ERROR] ... 7 more
[ERROR]

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: <parameters> tag not accepted in testng.xml after updating from TestNG 6.8 to 6.11 version.

kool79
It must be <parameter>, not <parameters>

пятница, 17 ноября 2017 г., 11:16:38 UTC+2 пользователь [hidden email] написал:
My suite file looks something like this:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "<a href="http://testng.org/testng-1.0.dtd" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA&#39;;return true;">http://testng.org/testng-1.0.dtd" [<!ENTITY parent SYSTEM "src/test/resources/base_params.xml">]> <suite name="MyTestSuite" verbose="1"> <parameters>&parent;</parameters> <listeners> <listener class-name="listener.ListenerClass" /> </listeners> <test name="Some Test"> <classes> <class name="test.Test" /> </classes> </test> </suite>

This worked perfectly fine till I was on TestNG 6.8 version, but soon after updating to TestNG 6.11 version, I get error "Element type "parameters" must be declared" on trying to run tests in this XML file.

I checked a related post on StackOverflow (<a href="https://stackoverflow.com/questions/43220066/testng-6-10-issue-with-parameters-tag-in-xml" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F43220066%2Ftestng-6-10-issue-with-parameters-tag-in-xml\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEO0ov652m492LbVrMdKBYU902w4Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F43220066%2Ftestng-6-10-issue-with-parameters-tag-in-xml\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEO0ov652m492LbVrMdKBYU902w4Q&#39;;return true;">https://stackoverflow.com/questions/43220066/testng-6-10-issue-with-parameters-tag-in-xml), but it did not help.

Here's the full error log.

[ERROR] org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 16; Element type "parameters" must be declared
[ERROR] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:324)
[ERROR] at org.testng.TestNG.run(TestNG.java:1101)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
[ERROR] Caused by: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 16; Element type "parameters" must be declared.
[ERROR] at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
[ERROR] at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
[ERROR] at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1906)
[ERROR] at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:742)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
[ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
[ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
[ERROR] at javax.xml.parsers.SAXParser.parse(SAXParser.java:195
[ERROR] at org.testng.xml.XMLParser.parse(XMLParser.java:39)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:16)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:9)
[ERROR] at org.testng.xml.Parser.parse(Parser.java:170)
[ERROR] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:304)
[ERROR] ... 7 more
[ERROR]

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.