我正在通过Jenkins集成在AWS上运行测试,这个测试需要上传一个文件。为了上传文件,会打开一个“上传文件”窗口(文件浏览器),但是这会触发错误。
[java] [INFO ] [2:53:49PM] Thread-1 (TestMethodRunner.java:188) - 未设置X11 DISPLAY变量,但此程序执行了需要它的操作。 [java] [INFO ] [2:53:49PM] Thread-1 (TestMethodRunner.java:189) - java.awt.HeadlessException: 未设置X11 DISPLAY变量,但此程序执行了需要它的操作。 [java] at sun.awt.HeadlessToolkit.getSystemClipboard(HeadlessToolkit.java:307) [java] at com.proquest.apps.etd.pqaf.layer.FileUploadWindow.uploadingFile(FileUploadWindow.java:50) [java] at com.proquest.apps.etd.regression.tests.SmokeTest.smokeTest(SmokeTest.java:100) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [java] at java.lang.reflect.Method.invoke(Method.java:606) [java] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) [java] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) [java] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) [java] at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) [java] at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) [java] at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) [java] at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47) [java] at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47) [java] at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47) [java] at org.junit.rules.RunRules.evaluate(RunRules.java:18) [java] at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) [java] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) [java] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) [java] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) [java] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) [java] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) [java] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) [java] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) [java] at org.junit.runners.ParentRunner.run(ParentRunner.java:300) [java] at org.junit.runner.JUnitCore.run(JUnitCore.java:157) [java] at org.junit.runner.JUnitCore.run(JUnitCore.java:136) [java] at com.proquest.testing.TestMethodRunner.runUnitTest(TestMethodRunner.java:194) [java] at com.proquest.testing.TestMethodRunner.run(TestMethodRunner.java:62) [java] at com.proquest.testing.SimpleThread.run(SimpleThread.java:13)
- 如何解决这个错误,我不能使用putty启用X11,测试是通过Jenkins运行的,测试每天在预定时间自动执行,因此我必须使其动态化?
- 是否有适用于“未设置X11 DISPLAY变量和Headless异常”的任何ivy依赖项可供使用?