I have a Jenkins V2.323 master running on Windows Server 2012 and a Node (agent) running Windows 10. Both computer are running Java 8 build 311 (build 1.8.0_311-b11).
To start my Node from my Windows 10 machine I do from command prompt:
java -jar agent.jar -jnlpUrl http://myDomain:8080/... -secret 154jnjn4jn33... -workDir "C:/Jenkins"
That way, I’m able to start my pipeline using my Node. Also this Windows 10 node have a physical monitor and I’m login in the session (no remote desktop)
After that, in my pipeline (JenkinsFile) I start a Python script. This script is using pyautogui to automatize GUI testing. When performing the GUI test, it fail because the Node is start from the command line
java -jar agent.jar and no GUI is found.
Running same Python script locally on the Windows 10 node works fine
Other solution found on the internet are using the Launch agent from browser.
Dec 15, 2021 3:47:19 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping] Dec 15, 2021 3:47:19 PM org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader run INFO: Waiting for ProtocolStack to start. Dec 15, 2021 3:47:20 PM hudson.remoting.UserRequest perform WARNING: LinkageError while performing UserRequest:hudson.slaves.SlaveComputer$SlaveInitializer@1f8358 java.lang.ExceptionInInitializerError at hudson.slaves.SlaveComputer$SlaveInitializer.call(SlaveComputer.java:1050) at hudson.slaves.SlaveComputer$SlaveInitializer.call(SlaveComputer.java:1041) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:122) at java.lang.Thread.run(Unknown Source) Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "hudson.util.RingBufferLogHandler.defaultSize" "read") at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at com.sun.javaws.security.JavaWebStartSecurity.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPropertyAccess(Unknown Source) at java.lang.System.getProperty(Unknown Source) at java.lang.Integer.getInteger(Unknown Source) at java.lang.Integer.getInteger(Unknown Source) at hudson.util.RingBufferLogHandler.<clinit>(RingBufferLogHandler.java:39) ... 11 more
This issue was also posted where:
Also Jenkins is moving from Java 8 to 11, and Java Web Start is remove in Java 11
Java Web Start has been removed in Java 11. When a Jenkins controller runs on Java 11, the Java Web Start button will no longer appear in the Web UI. You can’t launch agents for a Java 11 Jenkins server from a
*.jnlpfile downloaded to a web browser. There are no plans to replace this functionality. Connect agents to Jenkins on Java 11 with plugins like SSH Build Agents Plugin, with operating system command line calls to
java -jar agent.jar, or using containers.
Finally, I try to run the Node as a Windows Service.
But the option seem to have been remove since the File is no more available:
Regarding all this information, what is the best way to do GUI testing on a Windows Node?
Thanks in advance for your help,