Dynamic Selector not working on some columns

Hello folks,

I am trying to create a bot that inserts rows into a grid on a Web page and populates two of the columns within each newly inserted row. Since different users of this bot may have the columns in different order, I am storing the column numbers as variables (i.e. AccountColnum and SubaccountColnum). Hence, I am creating the selectors dynamically using the String variables account_selector and subaccount_selector respectively, and using the Type Into activity to populate those columns.

The problem is that when I run the bot, it skips the first field (i.e. account) and goes straight to the second field (i.e. subaccount).

To debug this, I tried inserting an extra static Type Into activity for account, right before the dynamic one. The results were as expected: it populated the Account field twice. (i.e. In other words, the dynamic version of the Type Into activity worked, provided I executed a static version of the same Type Into activity immediately beforehand.) So the dynamic selector appears to be correct. Moreover, the other dynamic selector (i.e. for subaccount) is identical to the Account one, aside from the column number being different, and there is no problem executing it.

I tried various things like (1) inserting delays before the first Type Into activity, (2) Inserting a Set Focus activity on the Account column right before the Type Into, etc. but to no avail.

In case it helps, another thing I noticed is that I am able to highlight the Account field in UI Explorer (using the hard-coded version of my text), but I am not able to highlight the field in Edit Selector within my Type Into activity. So there seems to be a disconnect between UI Explorer and the Edit Selector of the activity.

Attached are teh dynamic selectors which I have been trying to use, plus the static version which I used for debugging.

Again, the 2nd dynamic one always works, but the 1st one require some coaxing before it works (i.e. by first executing a static version of the same Type Into activity).

Dynamic Selectors.docx (11.6 KB)

Notice in the static version I have replaced the variable AccountColnum with ‘1’, and also I replaced the lengthy “id” tag with tableRow=‘1’ (i.e. for adding new rows on top).

For clarity, I am attaching a document with some screenshots from UIPath.
Troubleshooting.docx (573.4 KB)

@Ashley_Gates_US_ADVS - You can use Anchor Base activity because when you are trying to click on any element of DataTable some of the elements of DOM might be interchanged. So it will be good to find the Unique element in that row and use it as an anchor or you can use regex in selector as well.
Here are some links which might be helpful.


Thank-you Anmol!

I was finally able to get my bot to work, thanks to you pointing me in the right direction. It turns out I didn’t need to use regex, but a wildcard character in the ‘id’ element did the trick (i.e. as opposed to excluding the ‘id’ element altogether).

For reference, and to close this post, here is the final solution to the problem:

1 Like

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