Wildcards in selector

Can some one explain me how to use wildcard in selector to select first element in the page everytime

Hi @Vamsit2030,

Welcome to UiPath Community Buddyā€¦Do you have any selector on hand for example, or can we provide you with some examplesā€¦?

Cheers

HI @Vamsit2030,

Wild card charaacters are incase if the selector contains an attribute which is changing for example id of an field most of the times it changes so this things are handled by using wildcards.

  1. asterisk is used when there are multiple characters which are dynamic in a selector

  2. Question mark is used when there is only one character changing the attribute.

and in your case as to select the first element, I think we donā€™t need to use wild cards, instead we can build the selector in static way using UIExplore.

Regards,
ShivaKarthik

1 Like

HI @Vamsit2030

welcome to the community!! :smiley:

yes. wildcards are used to replace dynamic elements of the selector so it can be used for many instances.

Example selector
<html title='ACME System 1 - Account - Log In' /> <webctrl tag='H1' aaname='Account - Log In ' />
So here, letā€™s assume the ā€œAccountā€ word in he title can change time to time. In that case we can change the selector as follows

<html title='ACME System 1 - * - Log In' />
<webctrl tag='H1' aaname='Account - Log In  ' />

So, adding ā€œ*ā€ will enable the selector to work regardless of what word is available in between those two dash characters. like wise we can use it any where in the selector to make usable in multiple instances. We can also add the wildcard to aaname property as well like this for example

<html title='ACME System 1 - Account - Log In' />
<webctrl tag='H1' aaname='*- Log In  ' />

Does it help?

3 Likes

Hi @Palaniyappan
I have an example

I want to use wildcard for INC0010059 so that click happens for the first incident

Can you share the sample selector againā€¦ looks like we are unable to view it

Greatā€¦Ok

So In that selector, Kindly replace INC0010059 with * symbol, like

<html ...../..

<Webctrl aaname = ā€˜Open record: *ā€™ parentid = ā€˜ā€¦ā€™ tagā€¦

I have added the example selector

So what happens is, If you have used click option for that selectors, it will selector any field or file and button with any name starting with Open record: ā€¦

And i have one more kind suggestion, some times parent id might be changing dynamically, if so replace that with Wildcard as wellā€¦

Hi @Vamsit2030

Is my reply visibleā€¦? If not kindly tell meā€¦

Hi @Palaniyappan

It is partially visible

ā€¦hope would be helpful

So what happens is, If you have used click option for that selectors, it will selector any field or file and button with any name starting with Open record: ā€¦

And i have one more kind suggestion, some times parent id might be changing dynamically, if so replace that with Wildcard as wellā€¦

Yes, the parent id is changing dynamically and i used wildcard
its working
Thanks for the help @Palaniyappan @Lahiru.Fernando

1 Like

@Vamsit2030 Thatā€™s Amazingā€¦Keep goingā€¦

1 Like

Hello @Vamsit2030,

Here you can know more about the wildcards

Regards
Balamurugan.S

1 Like

Hi,

I just want to ask how to get the numbers of records in this system possible output are (No Records, 1 Record, 400 Records) it depends on the patch panel Iā€™ve searched but upon using the wildcard still I cannot get the # of records. See below:

image

Hi thanks for your reply, I wanted to ask you, what would you do, if you want to scrape anything that comes into the aaname attribute?

Iā€™m using: aaname = ā€˜*ā€™. But the result itā€™s an empty stringā€¦thanks!

1 Like

Hi

Welcome to uipath community

We can go for get attribute activity and get the value of aaname

Cheers @Alexis_Ayala

Perfect Sir. Will give it a try
Thank you!

1 Like

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