Save region or image on a specific place in hard disk

Asked by Laura Fernández

I want my scrip save a image with the state of the application in a specific carpet when the test fail, I try to use screen.capture(), It's works but take all the screen, and I need just save the application windows screen, I can make a region with the application windows but how a can save that region?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Laura Fernández
Solved:
Last query:
Last reply:
Revision history for this message
Laura Fernández (lolahp21) said :
#1

dir = "" + os.path.dirname(getBundlePath()) + "\Imagenes de Error"
    imgNew = "Fail in " + num
    img = capture(regionDeLaPantallaDelSistema())
    shutil.move(img, os.path.join(dir, imgNew + ".png"))