Jenkins: outside any screen error --- no real screen --- needs a fake screen

Asked by önder

Hi everyone,

I have created a maven project and I am using Sikulix 1.1.2 version in this project (because 1.1.2 is available at maven repository). And the other framework I am using to organize the test cases is TestNG. I also am using Java language. When I run the tests locally as maven test, everything goes very well. After that I decided to implement the project into pipeline. So the code is in the gitlab. I installed a Jenkins in to another workstation which has physical monitor always open. (Jenkins is running as windows service.) I integrated the jenkins with gitlab. Jenkins successfully checking out the codes from gitlab but when it triggers the test, cases get failed and and getting an error like "Location: outside any screen (46259874622,0) subsequent actions might not work as expected."

Project: maven project
java jdk: 1.8
Sikulix version: 1.1.2
TestNG version: 6.10

Is there any suggestion to solve the problem and run the test within this structure.
Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
önder
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Your Jenkins implementation does not have access to a real screen, which is needed by SikuliX.

Look into the net for solutions, how to get a usually X11 based "fake screen" running in that environment.

The package xvfb for example is a candidate. I have this running on TravisCI (a cloud build system with features like Jenkins).

Revision history for this message
RaiMan (raimund-hocke) said :
#2

BTW: version 1.1.4 is available either from OSSRH as snapshot or even as complete fat jar from the SikuliX download page.

Revision history for this message
önder (marquis06) said :
#3

Hi RaiMan;

thanks for your quick response.
I forgot to tell that operation system is windows, so there is no solution like xvfb. But after your comment I searched for how to configure the jenkins to let it access to the screen and starting jenkins from command line is solved my problem. I was using jenkins as windows service.

Revision history for this message
Asheru (asheru93) said :
#4

@önder (marquis06)

Can you post the solution in details here?

Thank you!

Revision history for this message
önder (marquis06) said :
#5

sorry it was my fault not to share exact details.

-Environment: Virtual machine
- operating system: windows 10
- jenkins version: Jenkins 2.107

Note:
First I had installed the jenkins and tried to run it as a windows service. So I had done all the configuration (connecting to gitlab, defining the jenkins job etc) when it was running as windows service. But at the end, sikuli was getting an error like "Location: outside any screen"

So how I solved the problem
Steps:
1- download jenkins.war file from internet (its size ~72MB )
2- you can carry this file into proper folder (let's assume that the path is C:\jenkinswar)
3- run your command prompt as admin
4- navigate to root folder at command prompt (in this case it should be like C:\jenkinswar)
5- apply the given command:
java -jar jenkins.war
(C:\jenkinswar>java -jar jenkins.war)
(when I run the jenkins from .war, my old configuration was still reachable.)

that's it. now jenkins can get the full access on your screen.

Revision history for this message
Asheru (asheru93) said :
#6

Thank you! So I assume that I need a VM for this. Currently i'm trying to run the sikuli script via jenkins and i've created a slave that is my localhost machine but i still get the error with outside any screen. Maybe this is not a good approach and I have to use a virtual machine for this. what do you think?

Revision history for this message
önder (marquis06) said :
#7

not: if your are developing your program with eclipse, you must also run the eclipse from command prompt with admin rights. Otherwise you will get same error.
you know sikuli needs a screen which is always open and in our case we could not have that option. So we decided to run the jenkins in vm. Running sikuli in a vm is a good option to cut the physical screen dependency.

Revision history for this message
Asheru (asheru93) said :
#8

Ok, I will try with a VM then if this is an easier approach since sikuli always needs a screen. Thank you!