cannot change maximum number of matches in match preview

Asked by ircfas133

Hello All -

I tried to use findAll function to find all the PDF icons on my screen. There are 50 icons per iteration. However, when implement the following code, Sikuli only pick around thirty before going to the next iteration.

while True:
    for x in findAll("icon.png")
    click(x)
    ...
    click("next_page.png")

I tried to change the maximum number of matches in the match preview. I did so by click on the "icon.png." I saw there are only 10 matches, so I change that to 50 matches and clicked Okay. However, my preference didn't save in the sense that once I go in the preview page for "icon.png", the maximum matches are 10 again.

Could you please tell me how to solve this problem? I'm working on an urgent task that I hope to get it done by this weekend. Thank you!

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
ircfas133
Solved:
Last query:
Last reply:
Revision history for this message
Roman Podolyan (podolyan-roman) said :
#1

Hmmm... as a "quick and dirty" solution, I propose to try to split screen into multiple regions (overlapping, maybe) so that no more than 10 pdf icons could be in each, and use FindAll on each region separately, combining results together with additional operations.

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

The number in the preview has nothing to do with the number of matches reutende by findAll.

findAll should return all matches found. Might be that the shot is not good enough (too much background).

Send me a screenshot, so I can check it.

Revision history for this message
ircfas133 (ircfas133) said :
#3

Thank you guys for responding so quickly! :D

Right now I'm using Podolyan's strategy as a temp fix. However, it still pick 8 out of 10 icons on the screen.

Also, I also used region.findAll() by defining the region on which the icons appear. But the problem still persist.

Could you please tell me what I should try next? Thanks a lot, guys!

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

Send me a screenshot, so I can check it.

Revision history for this message
ircfas133 (ircfas133) said :
#5

Here is some of the observations of this problem:

1) I also zoom my browser to 150% so that the PDF icons appears larger. But this is a 100% fix.

2) By decreasing the similarity threshold, Sikuli will complete a higher percentage of the icon list.

         - For example, if I decrease the similarity to 30% it will click more icons I believe (I don't know whether is all the icons on the list).

        - But it will click the same icon more than once, so that instead of having 50 PDFs downloaded, it pulls 62 PDFs, some of which are duplicates.

Revision history for this message
ircfas133 (ircfas133) said :
#6

I just sent the screen shots to your @me.com email. Hope that is fine per policy...

Thank for your helping me out on this, guys -

Revision history for this message
ircfas133 (ircfas133) said :
#7

I just want to report back the following observation:

1. after I switch to another PC with jre1.6.0_24 and point the the IDE.bat file to this folder, the program works as intended so far.

2. the other PC on which this problem happens have jre1.6.0_24, but the IDE.bat file point to jre6 instead as default.

3. Both are Win 7 64 bit.

Revision history for this message
ircfas133 (ircfas133) said :
#8

The problem seems to be gone once I direct the Java6 folder to jre1.6.0_24, although I don't know what is the reason for this.