Robot Framework: capture screen and move to a new location
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.
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\
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.
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: