I’m pulling a multi-page data table from a browser and programmed the automation to click a button in that row if other conditions are met. The logic is working but I’ve found that I need to include the row value/position as a variable in the click activity in order for the button position to match the current row.
I’ve created a row counter variable as an output for the For Each Row activity but here’s the hiccup–– my data table spans multiple pages and each page shows 10 rows so once I go past the 10th row, it doesn’t know where to click as 11 is just the 1st row again.
I was thinking maybe there is a regex or math calculation I could do to extract the “ones” place from the row number, as in row 39 would return 9. However, I’m not sure how to extract that as I’m fairly new to RegEx.
There also may be a simpler way of accomplishing this that I’m not thinking of.
You should use a For Each UI Element activity to click each CLAIM button. You can use a Do While around the FEUE activity to control clicking the next button.
- Do While (condition would be logic for “not on last page”)
** For Each UI Element
*** Click CLAIM button (with UI element from For Each)
** If not on last page
*** Click Next Page
There are different ways to control the Do While. You could parse the “1-10 of 279” text to see if you’re on the last page or not, or you could check the next button icon to see if there is a difference you could use in a Check App State selector to determine if it’s clickable or not.
I think For Each UI element is definitely on the right track but
- The program it’s interacting with updates and removes an item every time ‘Claim’ is clicked so it wouldn’t work to use the next button or the bottom row number listed.
- I pull the data from the ‘Time Since Created’ column to determine whether it should be claimed. Right now that’s inside the For Each Row and a RegEx activity. How could I integrate that with the For Each UI element activity?
Hi @M_Mahoney
In Your selector , Can you try this
“<your_selector_here> idx='” + (rowCounter Mod 10).ToString + “’ />”
Hope this helps
If it removes the button each time you click Claim, then For Each UI Element probably won’t work.
What you need to do is create a dynamic selector for the Claim button. Open UI Explorer, indicate one of the Claim buttons, and post a screenshot of the UI Explorer window so we can see the possible selector properties.
Keep in mind a manual row counter and dynamic selector using the row number also won’t work if the row disappears after you click Claim.
I did a few tweaks and this method worked! I created 3 variables.
ForEachRow output = RowCounter+1 (since the output starts at 0, ‘+1’ is added in later calculations)
RowTotl = ((RowCounter+1) Mod 10)
CurrentRowValue= if((RowTotl=0),10, RowTotl)
The last variable is used since the Mod 10 extracts only from the “ones” place of a number and there is no “idx=‘0’” in the UI element table.
Thanks everyone!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.