testing - How to click on some image which occurs multiple times on screen with sikuli with java? -


i writing script automation in java searches recordings mobile number , finds multiple recording in gridview. next trying download recordings clicking download (multiple)button(s). have written below code not work

public static screen s = new screen(); iterator <match> matches  =s.findall("downloadbtn_wh.png"); // s screen pattern pbutton = new pattern("downloadbtn_wh.png");  match mbutton;  while (matches.hasnext()) {     match m = matches.next(); // m inspected debugging     s.click(m); // click on drop-down      if ((mbutton = s.exists(pbutton))!=null) {         // checks button image , saves match         s.click(mbutton); // click match, not search again         break;     } } 

this script stops after clicking on first download button expect should click on every download button in gridview. images

the below code perform require.

@test public void multiplepattern() throws findfailed{      imagepath.setbundlepath("c:\\patterns\\");      screen s = new screen();     iterator<match> = s.findall("downloadarrow.png");      while(it.hasnext()){          it.next().highlight(1);     } } 

note: please note in above example not clicking highlighting detected patterns visualize process. replace highlight(1) click() before use in script.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -