cancel
Showing results for 
Search instead for 
Did you mean: 

How do you iteratively click similar buttons on a page?

kevin_b_hall
Level 3
Hi, To practice, I wanted to make a simple Blue Prism process that clicked each "Unfollow" button on a twitter page. I thought I could do this by looking at the path of an element and iterating the number that identified the "Unfollow" button but I can't figure out how to do this. For example let's say the first "Unfollow" button had the path value of "/HTML/BODY(1)/DIV(2)/DIV(1)" and the second had "/HTML/BODY(1)/DIV(2)/DIV(2)". Is there a way to put a variable within the path and use a counter to iterate through each button? Kind of like the following psuedocode? Counter = 1 UnfollowButtonPath = "/HTML/BODY(1)/DIV(2)/DIV({Counter})" UnfollowButtonCount = 300 Loop UnfollowButtonCount times { Click UnfollowButton with Path == UnfollowButtonPath Counter + 1 } Or is there no way to dynamically change an element or have some kind of pattern recognition?
3 REPLIES 3

GongquanZHANG
Level 2
This is also my question. Any way to solve these kind of issue?

JoakimEklund
Level 6
In application modeller you can set the path attribute to dynamic, thus enabling you to enter ""/HTML/BODY(1)/DIV(2)/DIV("" & {Counter} & "")"" within the navigate stage you use to click the button.

Thanks joakimeklund! After changing the element's Path to be dynamic (was not aware of this option) I was able to change the Parameter for Path in the Navigate action to change the text to be whatever I wanted and iterated through. Worked perfectly!