Script doesn't wait until image is found

Asked by Matthias Neudecker

I am trying to select an entry of a dropdown and wait for the result of the dropdown change to be displayed before continuing. To achieve this I want to use the fact that the selected entry is displayed in blue after the dropdown is closed after selection and turns white after the results are displayed.
However the script continues after the wait(5) command and displays the popup, although the <image of select with label (with selected option)> is not displayed yet.

This is the code I use:
---
click(<image of select with label>)
wait("<image of entry of select>",FOREVER)
click("<image of entry of select>")
wait(5)
wait("<image of select with label (with selected option)>",FOREVER)
popup("Results are displayed")
---

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

It is surely a similarity problem.

This should help:
- restrict the search area somehow to the region, where you expect the target to appear/change/vanish
- use a higher minSimilarity:
wait(Pattern("<image of entry of select>").similar(0.95),FOREVER) # max: 0.99 (do not use 1.0 or exact() )

If you do not get on the road:
pack some screenshots and image probes in a zip file and send to my mail at https://launchpad.net/~raimund-hocke

Revision history for this message
Matthias Neudecker (matthias-neudecker) said :
#2

Thanks RaiMan, that solved my question.