org.testng.TestNGException: TestNG by default disables loading DTD from unsecured Urls.问题解决

TestNG XML DTD错误

最近在tesgng跑测试用例时碰到了这个问题:

org.testng.TestNGException: 
TestNG by default disables loading DTD from unsecured Urls. If you need to explicitly load the DTD from a http url, please do so by using the JVM argument [-Dtestng.dtd.http=true]

解决方法:
在testNG的xml中删除这一行:

xml即可正常运行

----------------------------后续更新----------------------------------
以上做法可以调用xml配置文件启动测试脚本,但根本原因是testng版本过高导致的,我之前跑的testng版本是7.2.0,更换为7.0.0beta后问题解决

附maven依赖:

 
            org.testng
            testng
            7.0.0-beta7
            compile
        

你可能感兴趣的:(测试开发,TestNG)