【引入TestNG报错】SunCertPathBuilderException: unable to find valid certification path to requested target

在使用Eclipse和maven集成TestNG执行自动化测试脚本时遇到错误,原因是TestNG的jar包版本(6.14.3)与已安装的TestNG插件版本(7.4.0)不匹配。更新jar包至与插件相同版本(7.4.0)后,问题得到解决。
摘要由CSDN通过智能技术生成

首次使用eclipse+maven+TestNG运行自动化脚本报错,如下(部分报错信息):
[RemoteTestNG] detected TestNG version 6.14.3
org.testng.TestNGException: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at org.testng.TestNG.parseSuite(TestNG.java:327)
at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:348)
at org.testng.TestNG.initializeEverything(TestNG.java:995)
at org.testng.remote.support.RemoteTestNG6_12.initialize(RemoteTestNG6_12.java:22)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:98)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:145)

在这里插入图片描述

解决:
我安装的插件是7.4.0版本的,引入的TestNG的jar是6.14.3的,jar包 版本与插件不匹配,后边把jar改成7.4.0版本的就好了

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值