Does Sikuli have a function to save a screenshot as png while test is running

Asked by Ali Ahmed on 2021-01-08

Does sikuli have function where it captures screen during test and saves it in folder so I can view it later?

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
Ali Ahmed
Solved:
2021-01-08
Last query:
2021-01-08
Last reply:
Ali Ahmed (ali13xii) said : #1

Nevermind I found a solution.

import shutil
import os

some_region = SCREEN # for whole screen
#someRegion = App.focusedWindow() # for the frontmost windo
img = capture(some_region)
shutil.move(img,"/SikuliX/Result images/NameTest.png")
print("image is saved")