← Back to team overview

sikuli-driver team mailing list archive

[Question #167739]: To incorporate the Failed screen shots inside robot result

 

New question #167739 on Sikuli:
https://answers.launchpad.net/sikuli/+question/167739

Hi,

Thanks for ur time;

Can we incorporate the Failed screen shots inside robot result. 

Intention is if no match is found then it will be handled as an exception i.e. 1st it will take a screen shot and will throw an error and exit - this error message should get incorporated inside robot result too.

My code is:

def sikFind(arg):
    try:
       find(Pattern("Bar Horizontal.png").similar(0.99))
   except FindFailed:
      theImage = robot.createScreenCapture(Rectangle(Toolkit.getDefaultToolkit().getScreenSize()))
      ImageIO.write(theImage, "png", File(r"D:\Selenium-screen.png"))
#########################################################
Now if I put exit(1) at the last line of my code it definetly comes out but this message is not incorporated inside robot result - infact no result file gets created. 
If 'try/except' is not used - then no screen shot is taken in the result



Note: Taking screen shot has been refferd from "https://answers.launchpad.net/sikuli/+question/164161";;


Regards
Subha





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