当前位置: 首页 > 面试题库 >

Maven Surefire无法在Jenkins上实例化我的IReporter类

汪正雅
2023-03-14
问题内容

我有一个Jenkins项目,由于无法实例化TestNG
IReporter类CustomReportListener.java(CRL)而无法运行。如果删除所有对它的引用,则该项目运行良好,但需要通过CRL返回结果。最后,CRL是我们作为JAR包括在内的框架的一部分,并且使用该JAR中的任何其他类进行测试似乎没有问题。

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project fordna: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process
[ERROR] org.testng.TestNGException:
[ERROR] 
[ERROR] Cannot instantiate class com.perficient.util.result.CustomReportListener
[ERROR] at org.testng.internal.ClassHelper.newInstance(ClassHelper.java:53)
[ERROR] at org.testng.TestNG.initializeConfiguration(TestNG.java:981)
[ERROR] at org.testng.TestNG.run(TestNG.java:1089)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:281)
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:121)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
[ERROR] Caused by: java.lang.ExceptionInInitializerError
[ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[ERROR] at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[ERROR] at java.lang.Class.newInstance(Class.java:442)
[ERROR] at org.testng.internal.ClassHelper.newInstance(ClassHelper.java:51)
[ERROR] ... 8 more
[ERROR] Caused by: java.lang.NullPointerException
[ERROR] at sun.awt.shell.Win32ShellFolder2.access$200(Win32ShellFolder2.java:72)
[ERROR] at sun.awt.shell.Win32ShellFolder2$1.call(Win32ShellFolder2.java:242)
[ERROR] at sun.awt.shell.Win32ShellFolder2$1.call(Win32ShellFolder2.java:237)
[ERROR] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[ERROR] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[ERROR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[ERROR] at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Win32ShellFolderManager2.java:547)
[ERROR] at java.lang.Thread.run(Thread.java:745)
[ERROR] -> [Help 1]

我尝试了很多方法,包括在Jenkins上作为自由样式作业运行它,并尝试以下Surefire设置,通常是一个一个地设置:

  • <groupId>org.apache.maven.surefire</groupId> <artifactId>surefire-testng</artifactId> <version>2.19.1</version>
  • <useManifestOnlyJar>false</useManifestOnlyJar>
  • <useSystemClassLoader>false</useSystemClassLoader>
  • <reuseForks>false</reuseForks>
  • <forkCount>0</forkCount>

完整(标准)构建结果:

Building in workspace C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\workspace@2
Updating https://subversion.thecompany.com/svn/automation-test-center/trunk/FunctionalAutomation/ExampleProject at revision '2017-02-13T11:22:42.215 -0500'
A         target\log4j2.xml
U         pom.xml
At revision 3271

Parsing POMs
Modules changed, recalculating dependency graph
Established TCP socket on 56149
[workspace@2] $ "C:\Program Files\Java\jdk1.8.0_121/bin/java" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=5001 -cp "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-agent-1.8.1.jar;C:\Maven3.3.9\apache-maven-3.3.9\boot\plexus-classworlds-2.5.2.jar;C:\Maven3.3.9\apache-maven-3.3.9/conf/logging" jenkins.maven3.agent.Maven33Main C:\Maven3.3.9\apache-maven-3.3.9 "C:\Program Files (x86)\Jenkins\war\WEB-INF\lib\remoting-3.4.1.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-interceptor-1.8.1.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.8.1.jar" 56149
Listening for transport dt_socket at address: 5001
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\workspace@2\pom.xml clean test -e -DsuiteFile=src/main/test/suites/ca/alpha/desktop/QA_FOC_Brochures_Alpha.xml -Drunvehicle=All Models
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.thecompany.automation:example-project:jar:2.0.0-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for com.thecompany.automation:automation-util:jar should not point at files within the project directory, ${basedir}/src/resources/lib/automation-util-1.18.1.jar will be unresolvable by dependent projects @ line 104, column 16
[WARNING] 'dependencies.dependency.systemPath' for com.gamma.servicesapi:servicesapi:jar should not point at files within the project directory, ${basedir}/src/resources/lib/ServicesClientLibrary-1.2.112.jar will be unresolvable by dependent projects @ line 111, column 16
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building ExampleProject 2.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ example-project ---
[INFO] Deleting C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\workspace@2\target
[INFO] 
[INFO] --- build-helper-maven-plugin:3.0.0:add-source (add-source) @ example-project ---
[INFO] Source directory: C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\workspace@2\src\main\objects added.
[INFO] Source directory: C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\workspace@2\src\main\test\classes added.
[INFO] Source directory: C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\workspace@2\src\main\test\suites added.
[INFO] 
[INFO] --- build-helper-maven-plugin:3.0.0:add-resource (add-resource) @ example-project ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ example-project ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\workspace@2\src\main\resources
[INFO] Copying 19 resources to resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ example-project ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 212 source files to C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\workspace@2\target\classes
[INFO] /C:/Program Files (x86)/Jenkins/jobs/QA_FOC_Brochures_Alpha/workspace@2/src/main/objects/com/alpha/global/Leads.java: Some input files use or override a deprecated API.
[INFO] /C:/Program Files (x86)/Jenkins/jobs/QA_FOC_Brochures_Alpha/workspace@2/src/main/objects/com/alpha/global/Leads.java: Recompile with -Xlint:deprecation for details.
[INFO] /C:/Program Files (x86)/Jenkins/jobs/QA_FOC_Brochures_Alpha/workspace@2/src/main/test/classes/com/alpha/global/TC_GUX_BNP.java: C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\workspace@2\src\main\test\classes\com\alpha\global\TC_GUX_BNP.java uses unchecked or unsafe operations.
[INFO] /C:/Program Files (x86)/Jenkins/jobs/QA_FOC_Brochures_Alpha/workspace@2/src/main/test/classes/com/alpha/global/TC_GUX_BNP.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ example-project ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\workspace@2\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ example-project ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ example-project ---
[INFO] No tests to run.
[INFO] Surefire report directory: C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\workspace@2\test-output
Running TestSuite
Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[JENKINS] Recording test results
hudson.AbortException: Test reports were found but none of them are new. Did tests run? 
For example, C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\workspace@2\test-output\TEST-TestSuite.xml is 1 hr 51 min old

    at hudson.tasks.junit.TestResult.parse(TestResult.java:228)
    at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:148)
    at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:623)
    at hudson.maven.Maven3Builder$MavenExecutionListener.mojoFailed(Maven3Builder.java:656)
    at hudson.maven.Maven3Builder$JenkinsEventSpy.onEvent(Maven3Builder.java:300)
    at org.apache.maven.eventspy.internal.EventSpyDispatcher.onEvent(EventSpyDispatcher.java:104)
    at org.apache.maven.eventspy.internal.EventSpyExecutionListener.mojoFailed(EventSpyExecutionListener.java:138)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:90)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:219)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:129)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
    at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:133)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:68)
    at hudson.remoting.UserRequest.perform(UserRequest.java:153)
    at hudson.remoting.UserRequest.perform(UserRequest.java:50)
    at hudson.remoting.Request$2.run(Request.java:336)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 37.141 s
[INFO] Finished at: 2017-02-13T11:23:42-05:00
[INFO] Final Memory: 31M/266M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project example-project: Exception in provider:
[ERROR] Cannot instantiate class com.thecompany.util.result.CustomReportListener: ExceptionInInitializerError: NullPointerException
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project example-project: Exception in provider
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:129)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
    at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:133)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:68)
    at hudson.remoting.UserRequest.perform(UserRequest.java:153)
    at hudson.remoting.UserRequest.perform(UserRequest.java:50)
    at hudson.remoting.Request$2.run(Request.java:336)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.MojoFailureException: Exception in provider
    at org.apache.maven.plugin.surefire.SurefirePlugin.assertNoException(SurefirePlugin.java:328)
    at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:318)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:892)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:755)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    ... 31 more
Caused by: org.apache.maven.surefire.booter.SurefireExecutionException: Exception in provider
    at org.apache.maven.plugin.surefire.InPluginVMSurefireStarter.runSuitesInProcess(InPluginVMSurefireStarter.java:87)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1010)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:862)
    ... 34 more
Caused by: org.testng.TestNGException: 
Cannot instantiate class com.thecompany.util.result.CustomReportListener
    at org.testng.internal.ClassHelper.newInstance(ClassHelper.java:53)
    at org.testng.TestNG.initializeConfiguration(TestNG.java:981)
    at org.testng.TestNG.run(TestNG.java:1089)
    at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:281)
    at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
    at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:121)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:202)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:155)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:81)
    at org.apache.maven.plugin.surefire.InPluginVMSurefireStarter.runSuitesInProcess(InPluginVMSurefireStarter.java:82)
    ... 36 more
Caused by: java.lang.ExceptionInInitializerError
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at org.testng.internal.ClassHelper.newInstance(ClassHelper.java:51)
    ... 49 more
Caused by: java.lang.NullPointerException
    at sun.awt.shell.Win32ShellFolder2.access$200(Win32ShellFolder2.java:72)
    at sun.awt.shell.Win32ShellFolder2$1.call(Win32ShellFolder2.java:242)
    at sun.awt.shell.Win32ShellFolder2$1.call(Win32ShellFolder2.java:237)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Win32ShellFolderManager2.java:547)
    ... 1 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[JENKINS] Archiving C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\workspace@2\pom.xml to com.thecompany.automation/example-project/2.0.0-SNAPSHOT/example-project-2.0.0-SNAPSHOT.pom
channel stopped
Finished: FAILURE

此外,如果我在测试套件中删除了对CRL的调用,它将在到达对CRL静态方法之一的调用时尝试运行并返回此错误:

CRL静态方法调用错误

Tests run: 10, Failures: 10, Errors: 0, Skipped: 0, Time elapsed: 12.843 sec <<< FAILURE! - in TestSuite
init(ca.alpha.desktop.TC_FOC_Brochures)  Time elapsed: 0.39 sec  <<< FAILURE!
java.lang.ExceptionInInitializerError
    at ca.alpha.desktop.TC_FOC_Brochures.init(TC_FOC_Brochures.java:98)
Caused by: java.lang.NullPointerException

…具有:

Results :

Failed tests: 
ca.ford.desktop.TC_FOC_Brochures.init(ca.alpha.desktop.TC_FOC_Brochures)
  Run 1: TC_FOC_Brochures.init:98 ExceptionInInitializer
  Run 2: TC_FOC_Brochures.init:98 NoClassDefFound Could not initialize class com.thecom...

有没有人遇到这样的错误?我从这里去哪里?提前致谢。


问题答案:

替换该行(由于导致失败javax.swing.filechooser.FileSystemView

public static final String BACKUP_DIRECTORY =
        FileSystemView.getFileSystemView().getHomeDirectory().getAbsolutePath() + "\\Selenium Results\\";

通过

public static final String BACKUP_DIRECTORY =
        System.getProperty("user.home") + "\\Selenium Results\\";

它应该可以按预期工作。



 类似资料:
  • 目前,我正在我的项目中创建一个Jenkins共享库,在实例化一个对象时遇到了一个问题。 我的应用程序的树结构 -day#1 --/詹金斯档案 --/src/File1。groovy --/测试/文件1规范。groovy --/vars/file1。groovy 从我的Jenkins文件中,我可以调用file1。函数,inturn将创建写入文件中的类对象/src/File1。groovy和它工作得很

  • 第一次来这里。我是C新手,花了好几个小时想弄明白这个问题。很抱歉问一个似乎很常见的问题。我一生都找不到答案。 我在visual studio中遇到以下编译错误: 我的理解是,这意味着我创建的纯虚拟函数尚未在子类中实现。据我所见,它已在intNode子节点中实现。我做错了什么?代码如下。提前谢谢! 在节点中。h: 在Node.cpp: 编辑...对不起,我忘了添加这个位。错误指向main中的此部分

  • 我在Ubuntu服务器上最近安装的Jenkins上运行自动化项目时遇到了麻烦。我有以下错误: 我已经读到应该更新selenium webdriver gem,但我已经更新了它。也在詹金斯安装了firefox插件,但仍然无法运行。

  • 问题内容: 当我尝试运行此代码时: 我收到此错误: 我不明白为什么我无法实例化课程…在我看来似乎是对的… 问题答案: 是一个接口,因此您无法直接实例化它。您可以实例化一个具体的子类,例如:

  • 当我试图运行我的脚本时,我收到以下错误

  • 这是我的黄瓜基类。 在运行这个基类之后,我看到下面的异常。