如何解决TestNGException [RemoteTestNG]检测到TestNG版本6.9.6

时间:2018-08-01 14:49:23

标签: java maven selenium testng

我从github克隆了一个混合框架(Maven + TestNG + PageObjectModel)以启动我们的自动化。当我尝试将testng.xml文件作为testNg运行时,总是抛出以下异常,我无法通过遵循故障排除方法来解决。  1.将项目转换为TestNG并无法运行maven安装。  2.运行mvn全新安装无效。

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18:test (default-test) on project MartiniWorkshop: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18:test failed: There was an error in the forked process
[ERROR] java.util.ServiceConfigurationError: org.testng.ITestNGListener: Provider com.intuit.tools.common.teststatus.DisabledTestHook could not be instantiated
  1. 在“运行”配置中设置类“ com.intuit.team.tests.examples.HelloWorldTest”。
  2. 通过添加TestNg库来配置构建路径并不能解决问题

testng.xml(src / main / resources)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

<suite name="HelloWorldTest" parallel="methods" data-provider-thread-count="1" thread-count="1">
    <test name="SmokeTest" preserve-order="true">
        <packages>
            <package name="com.intuit.team.tests.*"></package>
        </packages>
    </test>
</suite>

例外:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option UseSplitVerifier; support was removed in 8.0
[RemoteTestNG] detected TestNG version 6.9.6
Exception in thread "main" org.testng.TestNGException: 
Cannot load class from file: 
    at org.testng.internal.ClassHelper.fileToClass(ClassHelper.java:521)
    at org.testng.TestNG.configure(TestNG.java:1413)
    at org.testng.remote.AbstractRemoteTestNG.configure(AbstractRemoteTestNG.java:74)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:235)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

0 个答案:

没有答案