Re: [Sikuli-driver] [Question #259550]: issue in comparing two images
Question #259550 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259550 Status: Open = Answered RaiMan proposed the following answer: basic information about the problem can be found in comment #3. ... and it shows, how one can workaround in most cases. In the original case (mentioned also in comment #4, we have a similar situation: we have 2 images, that only in some part show gray color instead of red. checking the match score, one can find, that one image against the other matches with a score of 0.98+ which results in a rounded value of 0.99 (shown in the match printout). So in this case just using Pattern(img).exact() already works (no need to double check) -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #259550]: issue in comparing two images
Question #259550 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259550 Eugene Maslov proposed the following answer: Sepid, take a look what I found . Your case is a strange one when two images look the same as a whole: probably, the total sum of differences returns zero diff number on average. But the images are found different in their parts! I cropped your image to the little key area of interest, and the difference will be detected quite reliably, even if similarity is reduced to 0.97. I executed the following script over your red image, displayed in the screen: http://www.hohmodrom.ru/upload/3/projimg/125631/files/color_confusion.gif step 3 mistakenly passed... but step 9 correctly failed! :) Thus, cropping the reference images, it's possible to catch the difference :) -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #259550]: issue in comparing two images
Question #259550 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259550 Eugene Maslov proposed the following answer: Raimund, I meant above that I heard that something in Java can deal with exact colors. I just didn't know that jRobot is accessible from Python. So now I solved my problem with pressed/released buttons, measuring the color inside the glyphs with jRobot. import java.awt.Robot as jRobot import java.awt.Color as Color def findWithColor(img, reg=SCREEN, color=Color(255,255,255), probe=[0,0], debug=False): myRobot=jRobot() res=None reg.findAll(img) found=list(reg.getLastMatches()) for but in found: probePoint=but.getCenter().offset(probe[0],probe[1]) myColor=myRobot.getPixelColor(probePoint.x, probePoint.y) if debug: print color at +str(probePoint.x)+: +str(probePoint.y)+:,myColor if myColor==color: res=but if not debug: break return(res) Settings.MinSimilarity=0.85 #Stable click on grayed button: findWithColor(unpressed.png,color=Color(204,219,233), probe=[2,2], debug=True).click() #Stable click on white button findWithColor(unpressed.png,color=Color(255,255,255)).click() Thank you very much for the suggestions. -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #259668]: onVanish() - Handler
New question #259668 on Sikuli: https://answers.launchpad.net/sikuli/+question/259668 Version: 1.1.0 2014-12-23_01:00nightly Language: Python Code: ### def myHandler(event): a = 1 reg.setROI(10,10,10,10) reg = Region(0,0,1400,800) a = 0 reg.onVanish(1419518759619.png, myHandler) reg.observe(background = False) reg.stopObserver() print a print reg.getX(), reg.getY(), reg.getW(), reg.getH() ### Question: Hey all! First, english isn't my native language, so sorry for my possible mistakes :( I'm trying to use onVanish() function, but it doesn't work. I wrote a little script to test it and my pattern that i used is a screenshoot file. First i open the screenshot, then i run the script with the IDE. It will be forever open if i don't do anything, but if i close the screenshot the script finishes, so i assume that onVanish() triggers correctly. But the result of the prints are: 0 0 0 1400 800 Although it triggers, it doesn't seem to call my handler. If i use onAppear() in this example the handler function will work correctly and will be called. Is it a bug? Or what am i doing wrong? Thanks :) -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #259668]: onVanish() - Handler
Question #259668 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259668 Rafael gave more information on the question: Oh, i forgot, the OS is Mac OSX 10.8.5. -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #259153]: How to use a shared folder location to store my screenshots and access it outside (from my desktop)?
Question #259153 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259153 Status: Needs information = Solved sathya confirmed that the question is solved: @Raiman The folder was not inside Program Files. And this change worked for me. (///hostnameof the remote server/failure_snaps, 'vrsnow') Thanks. Merry Christmas and a happy new year :) -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #259679]: Failure Screenshots with timestamp
New question #259679 on Sikuli: https://answers.launchpad.net/sikuli/+question/259679 @Raiman: I am using your modified version of html test runner which takes screenshots on failures. The thing is screenshots are replaced and overwritten on every run of the sikuli report. Can you help me to keep the failure screenshot names unique with a timestamp or something? so that the previous screenshots will not be overwritten and i can keep those for future reference. def addFailure(self, test, err): self.failure_count += 1 TestResult.addFailure(self, test, err) _, _exc_str = self.failures[-1] output = self.complete_output() self.result.append((1, test, output, _exc_str, self.generateTestScreenshot(test))) if self.verbosity 1: sys.stderr.write('F ') sys.stderr.write(str(test)) sys.stderr.write('\n') else: sys.stderr.write('F') Do i have to make any modifications in html test runner? # 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] imgpath = os.path.join(imgdir, %s-%s.png%(tc, tf)) shutil.move(capture(SCREEN), imgpath) return imgpath Thanks in Advance!! Cheers :) -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #259554]: install sikulixsetup-1.1.0.jar doesn't respond
Question #259554 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/259554 Status: Answered = Solved jerry confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp