← Back to team overview

sikuli-driver team mailing list archive

[Question #221802]: screen.capture() not saving a file but only when run from command line

 

New question #221802 on Sikuli:
https://answers.launchpad.net/sikuli/+question/221802

I am having trouble with screen.capture() not saving a file to the disk when I run from the command line instead of the IDE.

Using the following code, I can generate a screen shot of the whole screen from the IDE. The output is:
C:\Users\ADMINI~1\AppData\Local\Temp\sikuli-scr-5850548436041280312.png
The file exists.

Using the following code, when run from the command line the output is:
C:\SmokeTest>"c:\Program Files (x86)\Sikuli X\Sikuli-IDE.bat" -r takeScreenshot.sikuli
[info] Sikuli vision engine loaded.
[info] Windows utilities loaded.
[info] VDictProxy loaded.
C:\Users\ADMINI~1\AppData\Local\Temp\sikuli-scr-6619182572309329168.png
HOWEVER, the file sikuli-scr-6619182572309329168.png does not exist.


CODE:
def screenGrab():
    screen = Screen()
    return screen.capture(screen.getBounds())

print screenGrab()

More gory details:
running procmon.exe (similar to strace) 
I am able to confirm that in both cases the file is created successfully. (The system call CreateFile is successful)
but somehow the file isn't there when the program exits.

Any ideas why this is happening?


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.