-1

I am trying to run a test case in java selenium with testing in eclipse but I am getting the below error .Is there anyone who can help me.?

org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber: 34; columnNumber: 15; The content of element type "classes" must match "(class*,parameter*)".
    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)
Caused by: org.xml.sax.SAXParseException; lineNumber: 34; columnNumber: 15; The content of element type "classes" must match "(class*,parameter*)".
    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.handleEndElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(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:172)
    at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:305)
    ... 3 more
Anoop LL
  • 1,548
  • 2
  • 21
  • 32
Yogesh
  • 15
  • 1
  • 4

2 Answers2

0

I think this is because of white spaces in your testng xml

Try utf-8 as your encoding in your testng xml...

0

Thanks Guys, I had the same issue. But partially followed he above solution for me. Even i had not closed the tag. But i had closed it something like with in the tag ex:

 <class name="com.Grid.MobileGrid" />

But i tried doing it different like:

 <class name="com.Grid.MobileGrid">
 </class>

which worked, just posting this so that it can be helpful to some one in case. Its not about white space, some times closing the tag within the line doesnot work, u have to have it as a separate tag

Lokesh
  • 37
  • 2
  • 10