Sikuli script fails when run on projector screen or on multiple desktops

Asked by Vishal singh on 2018-02-15

I was researching about automation tool for GUI testing and i found sikuli
So i investigated about sikuli and found that it can be very useful for my application for creating automation scripts

I installed sikuli and wrote some test scripts performing GUI tests on our applications just to show my team how sikuli works and that we can further develop scripts in sikuli

I wrote my script when my laptop was connected to a docking station and i had two desktops

The problem i faced
1. When i ran the scripts on my laptop connected to projector the script failed due to an error
2. When i ran my scripts again this time only on laptop only two test case was executed infact i had four test cases i dont why
3. When again i connected my laptop to docking station only two test cases were executed it seems it skips the test cases in the middle and run only the first and the last one

Can someone please help me out with this i need to give presentation to my team again by fixing this issues

Example Script

Class sikuli():
       def setUp():
       def tearDown():
       def test_1():
       def test_2():
       def test_3():
       def test_4():

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
RaiMan (raimund-hocke) said : #1

not concrete enough.

1. ... the script failed due to an error
what error?

... testcases "not executed"?
what does that mean? errors? failures?

Are you aware of the multi-monitor setup and usages.
see docs.

Vishal singh (vishalsingh5900) said : #2

1. ft1.1: Traceback (most recent call last):
  File "C:\Tools\td5_gui_automation\Sikuli scripts\ImportProject.sikuli\", line 35, in test_importButtonOnToolbar
    wait("1516200019285.png", 5)
  File "C:\Tools\td5_gui_automation\Sikuli scripts\ImportProject.sikuli\", line 35, in test_importButtonOnToolbar
    wait("1516200019285.png", 5)
  File "C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\sikuli\", line 65, in wait
    return SCREEN.wait(target, timeout)
FindFailed: FindFailed: 1516200019285.png: (107x28) in S(0)[0,0 1920x1080] E:Y, T:3,0
  Line 2759, in file

I can see the image. The mouse goes half way to the screen and then stops and the scripts exits

2. Test cases not executed means
     As shown in the sample scripts it executes test case 1 and then it executes test case 4 and generates the reports for test case 2 and 3 it shows find failed error (same as above) in the reports

No i am not aware of the multi monitor setup and usages
Can you please send me the link ?

Best RaiMan (raimund-hocke) said : #3

at 1:
FindFailed: FindFailed: 1516200019285.png: (107x28) in S(0)[0,0 1920x1080] E:Y, T:3,0
not found on Screen 0, primary monitor.
which is the constant Object SCREEN in your case.
If the image is on one of the other screens in that moment, it will not be found.

at 2:
test cases usually are executed in alphabetical order.

BTW: you should not name anything sikuli - might lead to name clashes

be sure to use at least SikuliX 1.1.1 and have read across the docs:

Vishal singh (vishalsingh5900) said : #4

Thanks RaiMan, that solved my question.