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
Cheap Sikuli trick for screencaps is to have a defined region, then capture the region.
So if you've got a Chrome browser you want to cap, just set it up something like this:
App.focus('Chrome.app')
ChromeWindow = App('Chrome.app').window()
That will both focus the computer to the target application, and define a region composed of the window parameters of the application. Then run this:
capture(ChromeWindow)
Then use shutil (import shutil
) to move the file around to wherever you need it in your local directories. I usually put that code pile into a function I can call when needed TakePicture(Name)
where Name
is what I want to call the screencap when called in a particular test. Sikuli is both powerful and easy!