← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #168563]: How to get actual image if the expected image was not found

 

Question #168563 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/168563

    Status: Open => Answered

RaiMan proposed the following answer:
import shutil
shot = capture(SCREEN)
shutil.move(shot, "absolute-path-of-image.png")

the target directory must exist.

to pack this in test:

res = exists(Pattern(img).similar(0.8))
if not res:
    import shutil
    shot = capture(SCREEN)
    shutil.move(shot, "absolute-path-of-image.png")
assert(res)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.