org.testng.TestNGException:sun.security.provider.certpath.SunCertPathBuilderException [英] org.testng.TestNGException: sun.security.provider.certpath.SunCertPathBuilderException

查看:145
本文介绍了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
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)

我正在使用maven,testNG和selenium编写自动化脚本.当我通过RunAs-> TestNG分别执行我的TestCases时,它们执行的很好.但是,当我尝试通过以下方式将所有测试用例作为套件运行时:右键单击Testng.xml-> RunAs TestNG套件.我收到上述例外.

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.

到目前为止,我已经尝试了各种选项,例如升级TestNG版本(现在使用6.10.0),再次导入项目,更改POM和TestNG文件.到目前为止,一切都没有.

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.

我尝试使用Google进行搜索,但找不到此问题的答案.在线提供的任何解决方案都与SSL连接相对应,我不确定那是我的问题.

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!

推荐答案

问题似乎出在testng.xml上.确保.xml文件的第一行应与以下内容完全相同: <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

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">

这里唯一的问题是要使用"http"而不是"https"

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

这篇关于org.testng.TestNGException:sun.security.provider.certpath.SunCertPathBuilderException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆