I'm using Sikuli IDE. I'd like to know what the command to take a screenshot is, so I can capture the screen at the end of a test.
Something like this
try :
if bla bla bla:
print("blablabla")
else:
TAKESCREENSHOT() #------------------> What command do I put here?
print("TEST_FAILED")
The function is capture
, as in
screen = Screen()
file = screen.capture(screen.getBounds())
print("Saved screen as "+file)
It takes a screen-shot, saves it in a file, and gives you the path to that file back.
See the Sikuli documentation on it for full details.