org.testng.TestNGException: sun.security.provider.certpath.SunCertPathBuilderException

Deadly 提交于 2020-02-03 16:44:37

问题


I am getting:

 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)

I am working on writing automation scripts using maven, testNG and selenium. when I execute my TestCases individually through RunAs-> TestNG, they execute fine . But when I try to run all the Test Cases as a suite by doing: right Click on Testng.xml-> RunAs TestNG suite. I get the above exception.

I have tried various options so far, like upgrading the TestNG version(now using 6.10.0), importing the project again, changing the POM and TestNG files. Nothing has worked so far.

I tried to Google this but could not find the answer for this issue. whatever solution is given online corresponds to SSL connection and I am not sure that that's my issue.

Can anyone please help me with this issue? Thanks in advance!


回答1:


The issue seems to be with the testng.xml. Make sure the first line of .xml file should be exactly as: <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

the only issue here is "http" to be used instead of "https"



来源:https://stackoverflow.com/questions/49339698/org-testng-testngexception-sun-security-provider-certpath-suncertpathbuilderexc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!