Sikuli:Issue while selecting Dropdown value with text

Asked by Bindu

Hi,

I am using a flash application thats has two dropdowns, the second dropdown pops up on the screen up on selecting the value of first dropdown.

I am providing the value of the drop downs with text, the first dropdown is selecting the value based on i/p text, but the second dropdown is failing to select the text sometimes for certain values.

For example: values in the second dd are:

1. Fast Busy, Static which are being detected and selected properly by sikuli
2. Recorded message, One way audio are not being detected by sikuli and are not selected.

Please let me know whether to 100% rely on selecting the drop down values through text. Also, help me out if i need to take care of any font size or style or any other aspects.

Thanks,
Bin

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
Bindu (madhupenugonda-bindu) said :
#1

Also, is there any limit on the length the text that is being using in exists("some text") function, because with the above example, if I select the value with just "Recorded" or "One way" or "way audio", sikuli is selecting the value in second drop down,

Please find my code for reference

Screen s= new Screen();
Region reg;
int Flag=0;

     s.click("Select"); //dropdown is displayed initially as --Select--

   Match header = s.find("SelectImage.png");
   reg=header.below(150).left(5).right(1000);
   reg.hover(header);
   reg.type("R"); //first character of the dropdown value that I want to select

   do{
        if(reg.exists("Recorded message")!= null) //
         {
          reg.click("Recorded message")
          Flag=1;
         break;
         }
     else{
 reg.type(Key.DOWN);
           }
      }while(Flag!=1);

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

The text recognition is weak in the current version (see bug 710586).

So you have to live with the odds and find out, what works and what does not.

There is no limit on useable text length, but because of the odds, the longer the text, the higher the risk of failure.

So it is a good workaround, to use as search text that unique part of a longer text that is is found.

--BTW-- reg=header.below(150).left(5).right(1000);
your intention might be, to include the area left(5), but this is not the case, because the right(1000) always starts at header.x, no matter, what n you take with left(n)

to include it:
reg=header.below(150).left(5).left(1).right(1000);

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

Thanks RaiMan, that solved my question.

Revision history for this message
Robin Saunders (robin-saunders) said :
#4

I am struggling with this issue, too. I am trying to match some text in a pull down menu and then click on that to select it. I have tried matching on a quoted string, for example "text". I have tried matching on a snapshot of the text. I came across the similarity information in the doc, so I changed it to be .99. Still can't find what I'm trying to match.

Part of the difficulty is that several of the entries in the pull down menu are similar like lev/prod-v123, lev/prod-v124, lev/prod-v124m1... If I am looking for lev/prod-v124, it has matched on all of these at any given time... :( I know one night I got this to work at about 6pm and thought hurray, save that! Then ran my script the next morning and it couldn't find it again... I checked the link you give to the tesseract-ocr page, noticed they say that the accuracy drops off when the font is less than 10pt. I am testing an application that is a plugin to Eclipse, and it looks to me like for this field, Eclipse is using the system font. More investigating led to the system font being Segoe UI 9pt (I'm using WIN 7) and looking on Microsoft's site, it seems there is no way to change this. I tried updating one of the system settings so that everything would appear at 125% (so bigger text), but that didn't seem to work. Short of using coordinates on the pull down menu contents, which I was trying to avoid since that will change, I'm not sure what else to do. Suggestions? Have there been any improvements to this functionality?

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

@Robin
I got a fix suggestion from someone especially for improvements on small fonts.
I will test it the next days and come back.

Revision history for this message
Robin Saunders (robin-saunders) said :
#6

Oh, fingers crossed! Thanks for the quick response, will wait to hear back from you!

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of RaiMan
Sent: Tuesday, September 17, 2013 12:16 PM
To: Robin Saunders
Subject: Re: [Question #220471]: Sikuli:Issue while selecting Dropdown value with text

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

RaiMan posted a new comment:
@Robin
I got a fix suggestion from someone especially for improvements on small fonts.
I will test it the next days and come back.

--
You received this question notification because you are a direct subscriber of the question.