← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #256236]: Differing images matched with very high similarity

 

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

RaiMan posted a new comment:
If a webpage is not ready instantly and completed visually overcome time
in steps, you might get a found with low similarity.

This can either be compensated by adding some waiting time before the
search, or by creating a Pattern with the image and a similarity of
0.95, which would internally wait for screen content that satisfies the
condition.

I prefer the second solution.

problematic code:
click(button)
if (exists(Pattern(image).similar(0.5))

solution 1:
click(button)
wait(2)
if (exists(Pattern(image).similar(0.5))

solution 2:
click(button)
if (exists(Pattern(image).similar(0.95), 5)

this would give the search max 5 seconds time to find with a high score,
but the search would succeed already after 1 second if found with the
given similarity. So this is more dynamic and leads to faster scripts in
the average.

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