I successfully managed to address a similar case. Below is what I did:
- Get the selector (I used the Click activity and clicked on the the link)
- Step 1 will give you the selector in the Click activity’s selector attribute, copy the entire selector and find the unique ID eg. link ID in this case)
- Create an Int variable if the unique ID on step 2 is an integer (eg. CurrentIndex, this will be used within a Do While or While Do and increment after clicking the current link)
- Replace the unique ID on step 2 with the variable defined in step 3 (if the linkid=2 it would now read as “…linkid= '”+currentIndex.ToString+"’ src…). Note two things here, 1. the conversion of integer to string to be used in the selector, 2, use of single quote in selector HTML, if you use double quote instead it needs to be properly escaped)
- Assign the newly built selector to the string variable (eg. ModifiedSelector, this is to hold the modified selector string on step 4)
- Replace the content of Click activity’s Selector with the variable created on Step 5 (this is the point where the Click activity gets the dynamic selector at runtime).
There may be alternatives, but this works for me. Please do let me know if you have better working solution.
Good luck & have a nice day!