Help with selector

Hi,
I’m working on Ui-Automation where I wanted to extract a value from webpage.
I used classic get text activity to extract text and on the selector indicated value as well as anchor. But when I made the value as dynamic (aaname = ‘*’) the value is not highlighting.

Can anyone suggest a solution for this?

@Nisha_K21,

Kindly share the selector you are using to understand what could be the best approach here.

That’s not making it dynamic. Dynamic is when you use a variable in the selector. By putting aaname='*' you’re making the aaname property absolutely meaningless (* means match anything) which is why your selector isn’t working.

@postwick My bad!! I’ve made aaname=‘*’ because the value is unique ID which keeps changing for all employee id

@ashokkarale ,

On the screenshot first aaname is the Anchor and the second name is the value
I want to extract that value even when when the employee id changes

@Nisha_K21,

If your aaname is dynamic then there is no point in keeping it in the selectors with *.

Check what all other properties you can use by UI Explorer.

Thanks,
Ashok :slightly_smiling_face:

If you’re just using a simple variable, highlight n9n0mmo and right click then select “use variable.” You can type it manually too, the syntax is…

aaname='{{yourvariablename}}'

If you have something more complex like an expression that determines the aaname value, then you can do…

String.Format("<html app='msedge.exe' title='Employee*' /><webctrl aaname='Unique ID' class='display-label' tag='DIV' /><nav up='1' /><webctrl aaname='{0}' class='display-field' tag='DIV' idx='1' />",*your expression*)

Also, that you have an idx in there tells me your selector is not detailed enough to be unique. It might be because it’s a DIV. It’s important to learn how to use the UI browsing pane on the left side of UI Explorer to drill down and find the correct element.

Using (*) will not highlight the value but it will select the text and give you the output.