Dynamic selector not working in Chrome, alternative?

Hi everyone, I’m migrating one of my bots from IE to Chrome so I’m having to change a lot of selectors.

Part of this bot functionality is to answer a short form based on the data present in the payload we send to it.

The problem comes when for one of these questions, the selector is not working. And what’s even weird, I already did this for my other bot and it’s working 100% fine (they use the same platform and answer the same form).

This is the question that it has to answer:
Capture

This is the selector I’m using to answer ‘United States of America’ to this same question in my already migrated bot:

<html app='chrome.exe' title='Acceptance and Continuance' />
<webctrl tag='DIV' aaname='*United States of America*Argentina*' class='aq' />
<webctrl tag='P' aaname='*United States of America*' />
<webctrl tag='INPUT' />

I’m currently using:
UiPath.System.Activities - v20.4.0
UiPath.UIAutomation.Activities - v18.4.5

The only alternative I found is to use ID-based selectors, but this isn’t enough since the ID of the elements in the webpage is dynamic so I have to adjust it very often.

Do you have any idea of why this is happening or how could I solve this problem?

Thanks a lot.

Hi,

Do you have selctor not found exception? If so,did you already identify which selector element is wrong? if not, can you try to check it one by one as the following, using Validation button and highlight button in Selector editor?

First

<html app='chrome.exe' title='Acceptance and Continuance' />

If it’s good, next

<html app='chrome.exe' title='Acceptance and Continuance' />
<webctrl tag='DIV' aaname='*United States of America*Argentina*' class='aq' />

Next

<html app='chrome.exe' title='Acceptance and Continuance' />
<webctrl tag='DIV' aaname='*United States of America*Argentina*' class='aq' />
<webctrl tag='P' aaname='*United States of America*' />

Finally

<html app='chrome.exe' title='Acceptance and Continuance' />
<webctrl tag='DIV' aaname='*United States of America*Argentina*' class='aq' />
<webctrl tag='P' aaname='*United States of America*' />
<webctrl tag='INPUT' />

Regards,

<html app='chrome.exe' title='Acceptance and Continuance' />

That first line shows as valid, but when I add

<webctrl tag='DIV' aaname='*United States of America*Argentina*' class='aq' />

it starts showing up as invalid.

What I still doesn’t understand is why in my other bot this selector works fine but it doesn’t work in this one, really weird

Hi,

Can you try to check selector of the element in the machine using UiExplorer? There might be some information to solve this matter.

Regards,

Hello @AgustinG ,

Please try to use Ui Explorer to check any of the button both in Chrome and in IE. If you a comparison between the valid selector which you are getting for IE and Chrome for an element, you can compare the similarities.

Surely it will give an insight to the changes required.

The selector I’m using for IE is

<html title='Acceptance and Continuance' />
<webctrl tag='DIV' aaname='*United States of America*Argentina*' class='aq' />
<webctrl tag='P' aaname='*United States of America*' />
<webctrl tag='INPUT' />

And it’s correctly selecting the radio button.

For most of the selectors to work in Chrome when I was doing the migration I just had to add the tag app=‘chrome.exe’ to the part and it would work.

That’s exactly what I did when I was migrating my other bot and it’s working fine, but now I want to do the same with this one and I’m getting this problem.

If I try to use ‘Indicate element’ function of the Click activity, the selector that I get is this one:

<webctrl id='302000001191129' tag='INPUT' type='radio' />

Which I can’t use because as I said, id changes every x time.

Hi Rahul, I’m using UiExplorer to try to search for an alternative but I’m not really used to it so it will take me some time :sweat:

Hi,

Can you share screenshot of UiExplorer as the following?

In that case, <webctrl tag='DIV' aaname='*United States of America*Argentina*' class='aq' /> or similar selector exists in the middle of center lane. We need to find difference between ie and chrome.

Regards,