How do I solve the issue of server name changing in selector?

I have a process which logs into a platform to upload documents. However after logging in my click selector will sometimes not work as the server name will change in the selector causing the bot to not work.
Under edit selector it shows:

The CANTONMENT is the server name and will change between the 3 servers.

Is there a way to fix this ?

Hi @Irfan_Adib, welcome to the Community.

As the selector is failing sometimes as the server name changes, you could see if you can incorporate any one of these approaches to tackle the issue:

  1. In the selector, try to pass the variable data which contains the name of the server accordingly. Modify the selector to be adaptable with the variable data like this:
<wnd app='chrome.exe' cls='Chrome_WidgetWin_1' title='How do I solve the issue of server name changing in selector? - *' />
<ctrl name='Sample' server='{{delData}}' />
  1. If the above approach doesn’t make any sense as per your use case, try incorporating the wildcard (* in your case) in the selector to make it server neutral.
<wnd app='chrome.exe' cls='Chrome_WidgetWin_1' title='How do I solve the issue of server name changing in selector? - *' />
<ctrl name='Sample' server='*' />

Hope this helps,
Best Regards.

Hello @Irfan_Adib ,
Use the WildCrads (*) in the server name selector. Or else use the variable to pass the server name in the selector tag.

Hi thanks for the reply.

So, if i replace the selector with *,


> <html app='msedge.exe' title='[*] CROSS - Home - User Role = SSUP' />
> <webctrl src='/cross/MainMenu.jsp' tag='FRAME' />
> <webctrl name='but9' tag='IMG' />


It would look like this.
But the selector does not get validated for all my clicks and some will still show validation error.

Hi thanks for the reply.

Unfortunately some of the clicks still cannot validate after usuing the wildcard.
image

@Irfan_Adib

Welcome to the community

Please open the selector in ui explorer and try finding the proper selector

Few thing you can use are wildcard like * …also other attributes like src are changing then can use partial * in place of full work…

Main agenda would be to find a selector which is generic and can be used across

Apart from * you can try searching for attributes from right top panel in ui explorer whicha re static like names of fields etc…

Also center top panel also will help you in finding a reliable selector

Cheers

@Irfan_Adib ,
Use Wildcard like

title=‘*CROSS - Home - User Role = SSUP’
src=‘**’

Or Else use the Variable to assign the server name and use the switch activity to assign the different server name for the specific variable.

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