笔者最近在用testng+maven时,运行编写的xml文件时,编辑器报了一个错,如下

报错:

[TestNGContentHandler] [WARN] It is strongly recommended to add "<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >" at the top of your file, otherwise TestNG may fail or not work as expected.Groups1
解决办法:

在xml文件中,添加一句:

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

文件如下:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="suitename">
    <!--运行所有类-->
    <test name="runAll">
        <classes>
            <class name="com.course.testng.groups.Groups1"></class>
            <class name="com.course.testng.groups.Groups2"></class>
            <class name="com.course.testng.groups.Groups3"></class>
        </classes>
    </test>
    <!--运行指定的分组-->
    <test name="runGroup1">
        <groups>
            <run>
                <include name="client"></include>
            </run>
        </groups>
        <classes>
            <class name="com.course.testng.groups.Groups1"></class>
            <class name="com.course.testng.groups.Groups2"></class>
        </classes>
    </test>

</suite>

 

相关文章:

  • 2021-06-15
  • 2021-10-07
  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-03
  • 2021-12-26
  • 2021-08-31
  • 2021-10-29
  • 2021-10-14
  • 2021-06-03
  • 2021-12-09
相关资源
相似解决方案