← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #213457]: exists function not working after defining region

 

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

    Status: Answered => Open

Alex Yi is still having a problem:
OK,

I've figured out one of the problem  The one with the
EIOTargetValueFor80SL.png is working now.  It's kind of stupid because
the reason it was failing was because of the previous test case.  In my
previous test case, I'm doing the same kind of test on the point right
next to this one and when I hover over to that point, that popup was
covering the image that I was looking for in the next test case.  So I
just added a hover(someotherimage) statement to put the mouse pointer
somewhere else to make that popup dissappear.  So now, that part is
working.

However, there is still the original issue that I don't understand and can't seem to figure out.  I've tried the following and narrowed the issue down and I guess I need explanation on why this behavior is occuring:
1. recaptured the comparison image
2. put a wait statement
3. hover over to somewhere else then come back
4. Put a if exists statement and then print out the similarity level of that image and then highlight that image before assertion.

So here is my code:
    def test_063VerifySafetyStockHoverValueForComparisonDollar(self):     
        getLastMatch().highlight(2)
        hover("ScenarioComparisonSummaryLabel.png")
        if exists(Pattern("ComparisonSafetyStockBarDollar.png").similar(0.98)):
            hover(getLastMatch())  
            wait(3)
        if exists("ComparisonSafetyStockHoverValueDollar.png"):
            print getLastMatch()
            getLastMatch().highlight(2)
        assert exists(Pattern("ComparisonSafetyStockHoverValueDollar.png").similar(0.96))     

Basically, the print statement returns random similarity levels between 0.78 - 1.00.  And thus, the assertion statement passes sometimes and fails sometimes.  This image is a straight screenshot and so it should be at least .99 in similarity level.
I have screenshots in the following dropbox link.  Basically, the whole image screenshot is the whole image with red bar on the right is the bar that I am testing when hovered.
https://www.dropbox.com/sh/dk2it0o2so8fso5/hlRe6raDv8
Any idea on this random behavior?

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