Scrit made on one machine executed in another fails

Asked by Geeta

I had prepared on script using SIKULI on one machine say WINDOWS VISTA ,later on I had copied the same script on another machine and tried to execute but the script fails in the first step. It was not able to recognize the screen that is there in the script.

Is this a Disadvantage of Sikuli that "SCRIPT Prepared on One Machine does work / fails to work when copied onto some other machine:
Please let me know the solution if any for running the scripts prepared on one machine to run fine on some other machine after copying them.

Question information

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

what error messages?

Revision history for this message
Geeta (geeta-gudaru) said :
#2

Please find the below error code:

ScreenMatchProxy loaded.
VDictProxy loaded.
Win32Util loaded.
ScreenMatchProxy loaded.
[sikuli] Stopped
[sikuli] An error occurs at line 1
[sikuli] Error message:
Traceback (most recent call last):
  File "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\sikuli-tmp7400443614342884636.py", line 1, in <module>
    doubleClick("1285919252342.png")
  File "C:\Program Files\Sikuli\sikuli-script.jar\Lib\sikuli\Region.py", line 129, in doubleClick
  Line 20, in file C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\sikuli-tmp7400443614342884636.py
 at edu.mit.csail.uid.Region.wait(Region.java:240) at org.python.proxies.sikuli.Region$Region$1.super__wait(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source)
edu.mit.csail.uid.FindFailed: FindFailed: 1285919252342.png can't be found.
  Line 20, in file C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\sikuli-tmp7400443614342884636.py

Thanks in Advance
Geeta

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

your scripts first line is:

doubleClick("1285919252342.png")
# "1285919252342.png" is shown as a thumbnail of your image in the IDE

The error:
edu.mit.csail.uid.FindFailed: FindFailed: 1285919252342.png can't be found.

This means, the respective image could not be found on the screen.

So you know the image, that should be doubleclicked: find out, why it was not found.

Revision history for this message
Vikas (pvssvikas) said :
#4

While dealing with similar issues, I figured out the following cases where i could workaround,

1) SIKULI IDE is identifying the pic displayed in the IDE instead of actual application window.
    1.1) Run the script from cmd prompt or drag the IDE to lower part of the screen such that image will not be visible on the desktop.
2) generating low resolution pic and trying it on High resolution screen.
    2.1) In the above case Sikuli was not able to identify the pic. whereas it was doing good if a pic generated from High resolution is used on low resolution screen.

Thanks,
-Vikas.

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

@ Vikas:

1) if you run a script, the IDE should hide its window. There is a bug reported, but I thought it was solved with 10.2.

2) thanks for the input. I will try it out and report a bug if this makes sense.

Revision history for this message
Vikas (pvssvikas) said :
#6

Hello RaiMan,

IDE is getting hidden but still somehow sikuli is able to get the same pic location of the IDE

Thanks,
-Vikas.

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

@ Vikas:

this may be a timing problem.

the first find may be processed to fast (if Win7/Vista: screen/windows fading effects). Try a wait(1) before doing anything in your script.

Revision history for this message
Geeta (geeta-gudaru) said :
#8

Thanks RaiMan, that solved my question.