Can't use dynamic selectors

Hi, I’m new to UiPath and I’m struggling with dynamic selectors, I’m currently experimenting with a task in which I open a browser then search for a term and return the total number of pages that’s at the bottom of the first page, the selector works fine but is static how can I make it dynamic so that it always returns that last number before the next button, thanks.

replace the dynamic part with {{variableName}}
e.g. if your variable is testVar you can put {{testVar}} in your variable

or you can edit the selector field in the properties


to make it
"html app = 'brave.exe'......<webctrl tag = '" + testVar.toString + '" />"

Thank you for your reply, I should elaborate more, I open the browser, navigate to google.com, search a specific term then get the total number of pages at the bottom, but that number changes depending on the term, I’m not using any variables I’m just getting the text and adding it to a variable, I’ll display this variable in a message box later.

Heres my sequence
Sequence.xaml (8.8 KB)

Steps:

  1. initialize pageNumber variable = 2
  2. start an infinite while loop, in each iteration check if page number selector exists (using Element exist activity)
    image
  3. if it exists, increment pageNumber, otherwise break away from the loop and decrease pageNumber by 1 to get total pages

Tests
test 1 (search term = “test” )
image
Result
image

test 2 (search term = “testasdsafsfgffadfdafds” )
image
Result
image

1 Like

Thank you very much.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.