Dynamic Selectors, Click is 99% match but not clicking

Hi All

As per the image below, I’ve successfully set up dynamic selectors before but on this one, it’s not automatically clicking as what is scraped by the Data Table, is not what applies to the ‘aaname’

This is the error log which confirms my suspicions I think:

Is there a way to make it click when there’s 99% chance it’s correct?

Hi @steve1977beyond ,
Use Dynamic selector using * Key.
try below dynamic selector.
aaname - strSubMenuLinks.Split(";"c)(0) followed by *
Selector
<webctrl parentid='giSelectionMatCardTitle_*|*' tag='SPAN' aaname='"+strSubMenuLinks.Split(";"c)(0)+"*' />

Regards,
Arivu

1 Like

Tried that but with no success

Also tried using a Fuzzy selector and it worked on the 1st link ( What is UiPath Fuzzy Selector And How to use Fuzzy Selector - YouTube) , but when it trys the 2nd link, it doesen’t work then.

So your method is potentially better - if i can get it it work

What I have done now is removed all spaces in the information that’s to be looked up in the data table - the only issue is that the values in the data table, still have spaces.

How would I remove spaces from each line in the data table?

you can trim whitespace from the start and end of strings using string.trim, or you can remove all instances of a space anywhere in the test by using string.replace(" “,”")

Also, if you are using modern activities then you can use ‘fuzzy selectors’ which have a bit more give in them, I havent had a ton of experience with them but that may answer your initial question around still clicking on a 99% match.

Thank you for the reply :slight_smile: I did use Fuzzy Selectors in the end, and got it clicking the first 4 boxes but then it failed.
So ultimately I’m going to try and fix the root cause and that’s the item captured in the data table, has less spaces when it’s clicked. All a bit bizarre why it’s not working tbh with you.

With regards to trimming the whitespace, I’m able to do that on a variable - how would i do it for a data table?

you can iterate through the datatable using a for each, then have an assign which performs the change. for example if the data you wanted to trim was in the first column if the datatable then you would:

Use For Each Row on the Datatable in question
then in the body of the for each have:
Assign:
To = Row(0)
Value = Row(0).tostring.trim (or a variant of this like the replace function I put earlier)

Then you are effectively going through each row of your table cleaning up the spaces from the text

Brilliant stuff - I have managed to get that working, but it’s highlighting a fundamental issue here.

As per the attachment, what I’m looking for, ties up 100% with what’s in the variable but it’s still not working.
If I use a fuzzy selector then it finds the first 4 but on the 5th it just says it cannot find the click activity.

What’s weird is where it says what the closest matches are, it should be using what’s in the variable surely, instead it’s using what’s on the page

So the closest match is what UiPath has read on the page and pulled as essentially potential matches. so this will be representative of whats on the page not whats in the variable.

Looking over this again, there is a different way you could also go about this, which would be to use wild cards in the selector. You will need to put some thought into what you want to keep and exclude from the piece of text but as an example - if the number at the beginning of the piece of text (in your example the 11.01 part) is unique then you could use that with a wildcard * after it.

This is easiest to achieve when the space is still left in the data, in which case you could put this in your selector to replace the {{strSubMenuLinks2b}} part:

{{strSubMenuLinks2b.split(" "c)(0)}}*

You should * out those extra spaces before the closing )

To resolve this issue, I firstly removed all the ‘&’ signs in the Datatable and replaced with a space.

Then when I began the process to dynamically click through I added two assign activities:

= Row(0).ToString
= .Replace(" “,”*")

I then referred to in the aaname to dynamically go through each one

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