Click randomly a repeated image using java code

Asked by Ponmani on 2019-01-24

Have captured an image that is repeated in a screen for n number of times(arrow mark)
Could you please provide me a piece of code in java, so that on each run, the image at any location is clicked.
Now am using below piece of code, with which only the last match of the image is clicked.
public void RndClik(String Path)
  {
   Match match = reg.exists(Path);
     if (null != match) {
      match.getCenter().offset(ran.nextInt(match.w), ran.nextInt(match.h)).click();}
     }

Sikuli-version-1.1.3
Java-J2Se1.5
MAC OS

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2019-01-24
Last reply:
2019-01-28
TestMechanic (ndinev) said : #1

Use findAll method and iterate via all found elements.

Can you help with this problem?

Provide an answer of your own, or ask Ponmani for more information if necessary.

To post a message you must log in.