DropDown Values not Selected Exactly

Asked by Bindu

Hi,

I have a dropdown called "countries" which has around 200 country names listed as its values. I captured all the 200 images and saved in a folder. I am using Eclipse IDE to create and execute the scripts. The countries with less number of characters are not being properly selected by sikuli. '

For example: when I want to select a country called Australia (Image that has word "Australia "), but Sikuli selects a country called Austria (Image that has word "Austria"). Simularly for Angola it selects cambodia. I am not understanding how is sikuli acting in this scenario. I know that sikuli cannot identify text properly in all the cases, but why is it showing issues with this dropdown values images.

Also for your reference, all other images are working fine in my application.

Please help me this situation to be resolved. Thanks

Thanks,
Bindu

Question information

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

If you are sure, the images are correct and good (little background, ...), then the only reason for a false positive (especially Angola <> Cambodia) is the fact, that the right entry is not visible at this moment (both are near the beginning of the list), so one with a lower similarity score is chosen.

On top I recommend to use
Pattern(img).similar(0.95) or even Pattern(img).similar(0.99) instead of only the image, to be sure, a find always uses the right one or fails with a FindFailed exception otherwise.

BTW:
Such drop down lists usually allow to select an entry, by simply typing the entry text:
click(drop_down) # opens list
type("Austria"+Key.ENTER)

should select the country Austria.

Revision history for this message
Bindu (madhupenugonda-bindu) said :
#2

Hi RaiMan,

Thank you for quick response, Actually I am finding the existence of this img with a region. So

region.exists(img)

Can you pls let me know how to include pattern(img).similar(0.99) in this statement.

Also, my application is flash and is not allowing me to type the whole country name as you said in the last hint.

Thanks,
Bindu

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Oh yeah: Flash is Trash ;-)

region.exists(pattern(img).similar(0.99))

If you still have problems: send me a shot of the drop down and your images zipped together silently to my mail at https://launchpad.net/~raimund-hocke - I will have a look at it.

Revision history for this message
RaiMan (raimund-hocke) said :
#4

uuuuuuuuppps:

region.exists(Pattern(img).similar(0.99))

Revision history for this message
Bindu (madhupenugonda-bindu) said :
#5

the above statement I tried Raiman, but it throws me an error Pattern(String) doesnot exist and do you want to create a method Patter(String). The String containes the path of the image say : C:\images\img.png

Revision history for this message
RaiMan (raimund-hocke) said :
#6

region.exists(Pattern(r"C:\images\img.png").similar(0.99))

or

region.exists(Pattern("C:\\images\\img.png").similar(0.99))

Revision history for this message
Bindu (madhupenugonda-bindu) said :
#7

Hi raimen,

I used below statements and it is working fine .

Pattern ExactDDValue_Img;
ExactDDValue_Img=new Pattern(DDValue_Path).similar((float)0.9);

Thanks for your quick response.... Really really you are supportive from the day I began learning Sikuli.

Thanks,
Bindu

Revision history for this message
RaiMan (raimund-hocke) said :
#8

Uuups, didn't realize: it is Java , sorry ;-)

Thanks for feedback.