Getting error while running a XML file in TestNG

0 votes
org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 8; Element type "test" must be followed by either attribute specifications, ">" or "/>".

This is the error I am getting while executing a XML file for testNG.

Here is the code that I used:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name = "TestNG">

    <test = "Testing TestNG">
    
        <classes>
        
            <class name = "testNG.AnnotationsDemo"/>
            
        </classes>
        
    </test>

</suite>

Can someone  help?

Dec 26, 2018 in Selenium by Sradha
• 1,720 points

edited Dec 26, 2018 by Sradha 1,032 views

1 answer to this question.

0 votes
Hello @Sradha,

The synatx of using test is not correct.

The syntax goes like this

<test>

</test>

or

<test name = "name ">

</test>

Error that you are getting is because you missed the name tag in your test.

Hope this helped.
answered Dec 26, 2018 by Rashmi

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

How to create a executable jar file for TestNG and the runnnig point should be the Xml file

Use Eclipse Export Wizard. While exporting, select "Create ...READ MORE

answered Aug 24, 2018 in Selenium by Meci Matt
• 9,420 points
2,111 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,110 points
980 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
1,139 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
881 views
+4 votes
1 answer
0 votes
1 answer

Getting error saying element not found in selenium

Hey @Jino, The things I figured out ...READ MORE

answered Dec 20, 2018 in Selenium by Shuvodip
612 views