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

edited Dec 26, 2018 by Sradha 16,394 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.

Encountering 'No test result files matching test-xml' error in Azure DevOps? Get solutions and insights from the Edureka Community. Dive into troubleshooting steps and best practices to resolve this issue and ensure smooth CI/CD pipelines.

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
• 28,140 points
7,679 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
8,088 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,500 points
13,747 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

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

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,178 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,910 points
7,253 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 3, 2020 in Selenium by Sri
• 3,190 points
7,890 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 21, 2018 in Selenium by Shuvodip
5,535 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP