我从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
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)