← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #259679]: Failure Screenshots with timestamp

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
yes, you might modify the function generateTestScreenshot like this:

   # added by RaiMan
    def generateTestScreenshot(self, test):
        imgdir = self.dirTestScreenshots
        imgpath = ''
        if imgdir:
            x = str(test).split()
            tf = x[0]
            tc = x[1].split('.')[1][:-1]
            tt = int(time.time()*100)
            imgpath = os.path.join(imgdir, "%s-%s-%s.png"%(tc, tf, tt)) 
            shutil.move(capture(SCREEN), imgpath)
        return imgpath

which will add a timestamp to the filename (stepping is 0.01 seconds,
which should be sufficient)

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