问题描述
我正在运行 testng 套件时出现错误,但是当我运行单个 testng 测试时,它的运行没有错误
I am running the testng suite getting the error, but when i am running single testng test its running without error
org.testng.TestNGException:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效认证路径
org.testng.TestNGException: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
org.testng.TestNGException: sun.security.provider.certpath.SunCertPathBuilderException: 无法找到请求目标的有效认证路径在 org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:325)在 org.testng.remote.AbstractRemoteTestNG.initialize(AbstractRemoteTestNG.java:136)在 org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:97)在 org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)在 org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
org.testng.TestNGException: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:325) at org.testng.remote.AbstractRemoteTestNG.initialize(AbstractRemoteTestNG.java:136) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:97) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
推荐答案
使用这个 xml 标头:
use this xml header:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
而不是官方的:
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
这篇关于org.testng.TestNGException:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效认证路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!