Whilst automating a website, I need to input data into a table on the site. By default the table only has 1 row, so you have to click a button to add more rows as needed (simple enough so far). However, the problem seems to arise when trying to enter the text for the 2nd+ rows. For some reason, no mater what combination of selectors i try, i cannot target the 2nd+ row.
When I inspect the html, i can see each Input field is given a unique html id based on the row it’s in - however uipath refuses to use these ids - instead ALWAYS filling in the first row again.
I have noticed though, that each of these new row Input fields are all given the same uipath_custom_id attribute for some reason. I assume this is why uipath keeps filling in the top row every time.
Is there any way to either manually force these custom_ids to be updated to unique values, or is there a way to get uipath to behave and target the Input element by the html id attribute (as specified in the selector) ?
I know the post is quite old, but I found no less than 4 similar questions on the forum, all unanswered so far, so I thought a solution might come in handy for some of the forum users.
My scenario was more or less comparable:
the bot was generating some new rows for a HTML classic table in a web app however, besides the 1st generated row, it failed to recognize (by that meaning that I couldn’t even [re]indicate the element to the bot, it was simply not “seeing” it) any other additional ones, no matter how much would I refine the selector. Anyhow, this behavior was only apparent if I had the bot operating in the app, while everything seemed to be fine when performing the same actions manually.
What was actually happening is that the UiPath chrome extension was assigning a certain “uipath_custom_id[s]” to the 1st row when it was generated, then wrongfully using the very same one[s] for any other row that followed - so it was perpetually detecting the 1st row only, no matter how many other were there.
Took a while to figure this out, but once identified, the solution that did it for me was quite simple - injecting a JS snippet on the page after each new row was generated, to remove that uipath id attribute:
"
function Remove_UiPath_IDs ()
{
var Target_Elements = document.getElementsByTagName(‘YourTargetElementTagHere’)
for (var i = 0; i < Target_Elements.length; i++)
{
Target_Elements[i].removeAttribute(‘uipath_custom_id’);
}
}
"