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,750 points

edited Dec 26, 2018 by Sradha 5,885 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

How to pass parameter through testng.xml file to a test case in Selenium Webdriver?

Hello Revathi, to pass parameter through testng.xml ...READ MORE

answered Jun 12, 2019 in Selenium by Abha
• 27,930 points
3,048 views
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,460 points
4,227 views
0 votes
2 answers

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,510 points
3,548 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31 in Selenium by Sri
• 2,970 points
4,552 views
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,890 points
2,604 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2 in Selenium by Sri
• 2,970 points
2,879 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
2,549 views