Dynamic Selector Missing UI Element

Hello guys, my bot was suppose to click on the list given (refer image below) based on excel. Then, the selector will read those excel one-by-one and find those word and click.

Unfortunately, my selector came out error: “Click ‘A https://mmls.mmu.edu…’: Cannot find the UI element corresponding to this selector: ”

I’m using assign method, make variable and transfer those input from excel to variable but it can’t read.
selector

Can you share an example of how you’re building the selector variable using Assign?

Also, as a general tip, you can make your selector dynamic without building a string externally and pass as seletor.
Just insert the variables in your workflow using following syntax:
{{variableName}}

e.g. < tag='INPUT' type='button' aaname='{{textfieldVariable}}'
This selector will match a button having aaname attribute set to the variable value.

I hope this helps.

Sorry a bit confusing the one you mentioning. For the example, I refer exactly from this video except that, mine read from excel instead of “Input Dialog” (credit: KB Tutorial) Dynamic Selectors In UiPath Rpa Part-1 - YouTube

As you see from the date on the video, it’s nearly 18 months old.
UiPath activities as usual have evolved significantly over that time :slight_smile:
You no longer have to use something "aaname='" & name & "' ..."
You can instead use the syntax I mentioned above.
Think of & name & as {{name}} but you also don’t need to assign a string variable.

Specific to your example and using video to demonstrate:

selector
In this image you have uploaded, the Assign activity build a String object selector which you must be passing in as an input argument to the Click activity, in Selector property.
Instead, if you click on the menu button (3 horizontal bars) on Click activity, and choose Edit Selector, it gives you a more advanced editor as seen below:

Here you can edit the value '30' to match an incoming variable as shown in the video.
Use <ctrl name='{{name}}' role='cell' />

The benefit here is that you can validate the selector and indicate element if needed. Then you just need to insert your variable wherever needed.
With the selector variable passed as a string, the ‘Edit Selector’ window isn’t as well-structured as shown above. It’s easier to manage this way.

I hope this helps explain the feature and how you can best utilize it.

1 Like

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