Screenshots in the script are no longer found after saving with "save as..."

Bug #570248 reported by AKeem
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
SikuliX
Fix Released
Critical
RaiMan
Nominated for Obsolete by Vladimir Petrov

Bug Description

Sikuli Version 0.9.9
Windows XP 32-bit
Java 1.6.0_20

This is the script I used:
openApp("calc")
# For the Windows calculator
type("12")
click()
# click on the screenshot of "+" with 82% similarity
type("13")
click()
# click on the picture of "=" with 82% similarity

That's the whole script.
It works well until I want to save it with "save as..."
After saving it with "save as..." the screenshots i have taken are no longer recognized from SIKULI. I have tried to take new ones, but they are not recognized too. i turned the sinilarity down to 1% but nothing was found.

After that i tried to proceed the same script in an unsaved File, and it works. After saving this new one with "save as..." the same happened as I described above.

Tags: idemenu
Revision history for this message
RaiMan (raimund-hocke) wrote :

someone else had problems with saving and reloading scripts after upgrading to java version 20. after going back to 18, everything worked fine.

Revision history for this message
AKeem (chefkoch83) wrote :

I've downgraded my Java Version back to 18, but I have still the same Problem.
Let's hope that it works better with SIKULI 0.10 or I have to use my Mac further ;-)

Revision history for this message
RaiMan (raimund-hocke) wrote :

During testing preview versions of 0.10, I found that when opening a script by e.g. dragging a script folder on to the Sikuli IDE short-cut on the desktop I will get exactly the same symptoms you are telling about: always FindFailed.

I tried different approaches and found, that when stating the IDE and opening a script with Menu File->Open, it works.

I just "relaunched" a version 0.9.9 and found the same situation that you are telling about, with one exception: when using Menu File-> open it works.

May be you are lucky too.

(Win7-32 with java 18)

Revision history for this message
RaiMan (raimund-hocke) wrote :

One last thing ;-)

the error is reported to the developers.

I use windows too, but I am happy with my Mac's :-)))

Revision history for this message
AKeem (chefkoch83) wrote :

Thanks for your help, but...

I have tried the new Version 0.10, but it is still the same problem...
It does not matter if I use Java V18 or V20.

Revision history for this message
Tsung-Hsiang Chang (vgod) wrote :

@Akeem,

Did you save the scripts in a path that contains non English characters?
If so, please try saving them in a simpler path, e.g. C:\ or D:\my-sikuli-scripts.

Revision history for this message
AKeem (chefkoch83) wrote :

I have saved my script as you told me in a simpler path like "C:\test.sikuli" and it worked.
The older path contained only English characters, but there were spaces in it, maybe that could be the problem.

Thanks a lot

Revision history for this message
Sebastian Lipp (mail-sebastian-lipp) wrote :

I'd also Problems with paths that contained blanks. I tried to involve a Sikuli-Script into a Linux bash script but it was not possible to call the .sikuli file while it was inside a folder that contained blanks. Quotation marks ( "/path/to the/scrpit.sikuli" ) or the console escape character 'backslash' ( /path/to\ the/script.sikuli) didn't worked. No problems after copied the .sikuli file in a path with no blanks.

Best regards

Changed in sikuli:
status: New → In Progress
Revision history for this message
Jesse Bastide (jesse-vsee) wrote :

With both 0.10 and previous versions, I am seeing the find failed bug after running my scripts for 3 to 4 iterations. I have been using 'save as' to save the scripts. The interesting thing is that there seems to be data loss as well. When I look at the folders with scripts, the 'find failed' message seems to correspond with the screenshots suddenly deleting themselves from the sikuli folder.

Saving the scripts as self-contained executables, I am getting the same symptoms. The file will execute fine for several iterations. It's file size will be, for instance, 43k. Then, after running a few times, the self-contained executable will suddenly drop to 4k in size, which would seem to indicate that the screenshots had inadvertently deleted themselves.

I would LOVE to deploy Sikuli in our UI test environment, but am having to give Silk a go because losing screenshots is making it unworkable. Let me know if I can provide any more info to help you guys out, it's a great concept.

-----
Environment:

On Vista x32

I just updated my java

C:\Users\admin>java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)

Revision history for this message
AKeem (chefkoch83) wrote :

@Jesse

This could help you:
- You could downgrade your Java to Version 18
- Save your scripts in a path without spaces and non-english characters, it might help too when the path is not too long.

After doing the things above, my older (not running) scripts are running well, now.

Changed in sikuli:
status: In Progress → Fix Committed
Revision history for this message
AKeem (chefkoch83) wrote :

In SIKULI Version 0.10.1 the Bug #570248 appers a little bit different.

If there are non-english charakters in the Save-Path the script won't start and you will get this message in the SIKULI Editor:

"SyntaxError: Illegal character in file '<string>' for encoding 'utf-8'"

You have to use only english characters in the Save-Path.

I hope this will help you

Revision history for this message
Paul Lennon (plennon) wrote :

I assume what I just experienced is the same bug, but in case not:
- I'm on MAC, Snow Leopard 10.6.4
- My script path contains no special characters, but the main script folder has a space in the name
- I did save as to create a backup, so to a sub-folder named 'backup'
- It seemed to go OK, but the script was not copied
- I repeated it, but got the same result
- I reopened the original script and the code is still there, but no images
- When I looked inside the package, there were png files for all the images I had captured, but ALL were empty

Seems to me the 'save-as' may have opened the source png files in 'write' mode then closed them...? Regardless, downgrading java clearly will not bring them back.

Lexen (lexen1)
summary: - Screenshots in the script are not longer found after saving with "save
+ Screenshots in the script are no longer found after saving with "save
as..."
RaiMan (raimund-hocke)
Changed in sikuli:
importance: Undecided → Low
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → x1.0
RaiMan (raimund-hocke)
Changed in sikuli:
importance: Low → Critical
tags: added: ide
removed: 32-bit as save screenshot windows
RaiMan (raimund-hocke)
tags: added: idemenu
removed: ide
RaiMan (raimund-hocke)
Changed in sikuli:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.