← Back to team overview

sikuli-driver team mailing list archive

[Question #179700]: Robot Framework: capture screen and move to a new location

 

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

Hi.

I have a function called test_teardown which looks like following:

def test_teardown():
    # Save the screen
    print "test_teardown: capturing the screen"
    captured_screen = capture(SCREEN)
    print "test teardown: screen was captured at ", captured_screen
    outfile = os.path.join(getBundlePath(), os.path.basename(captured_screen))   
    print "test_teardown: moving capture screen ", captured_screen, " to ", outfile
    shutil.move (captured_screen, outfile)

This code works fine in Sikuli IDE.

If Sikuli is used with Robot Framework, the capture works but the captured temporary file seems to be removed right away and the code fails. Here is the log message from Robot Framework:

- TEARDOWN: LU6200.Test Teardown
Start / End / Elapsed:	20111123 10:25:35.423  /  20111123 10:25:36.104  /  00:00:00.681
10:25:36.071	INFO	test_teardown: capturing the screen
test teardown: screen was captured at  C:\Users\pd.kim\AppData\Local\Temp\sikuli-scr-7443802522424196690.png
10:25:36.104	FAIL	TypeError: len() of unsized object

I commented out the last three lines and confirmed that the captured file was not there any more after the function was completed. 



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