Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 801
spinwheel Avatar asked Dec 11 '22 07:12

spinwheel


1 Answers

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"

like image 145
P Trimurti Dora Avatar answered Dec 22 '22 03:12

P Trimurti Dora