0

Here is the xml file and not sure what is missing here . Any suggestions here?

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="TestSuite" parallel="tests">
<test name="FireFox Test">
<parameters>
    <parameter name="platform" value="Windows" />
    <parameter name="browser" value="firefox" />
    <parameter name="version" value="62.0.3" />
    <parameter name="url" value="http://www.expedia.com" />
</parameters>
    <classes>
        <class name="testClasses.SeleniumGrid_ParallelTestFramework">
        </class>
    </classes>
</test>
<test name="Chrome Test">
<parameters>
    <parameter name="platform" value="Windows" />
    <parameter name="browser" value="chrome" />
    <parameter name="version" value="85.0.4183.121" />
    <parameter name="url" value="http://www.expedia.com" />
</parameters>
    <classes>
        <class name="testClasses.SeleniumGrid_ParallelTestFramework">
        </class>
    </classes>
</test>
</suite>

The full exception details are here

org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 13; Element type "parameters" must be declared.
    at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:324)
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:109)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)
Caused by: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 13; Element type "parameters" must be declared.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    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:170)
    at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:304)
    ... 3 more
  • Add your testng.xml – PDHide Oct 13 at 22:27
0

TestNG test tag doesn't have a parameters.

Try just add many parameter entries.

<test name="FireFox Test">
    <parameter name="platform" value="Windows" />
    <parameter name="browser" value="firefox" />
    <parameter name="version" value="62.0.3" />
    <parameter name="url" value="http://www.expedia.com" />
    <classes>
        <class name="testClasses.SeleniumGrid_ParallelTestFramework">
        </class>
    </classes>
</test>

Tutorial here. enter image description here

| improve this answer | |
  • Tried removing the <parameters> tag from testng.xml and the program is compiled successfully. Thank you for the response. – Vani Oct 19 at 21:39
  • You are welcome. If you could mark the answer as Accepted, the community would appreciate. – João Farias Oct 19 at 23:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.