Selector dynamic issue

I have a selector which is dynamic for some I’d it would be ui-id-1 and ui-id-3

How to get this in a variable and pass it in the selector

Go to the target selection in the properties panel of the activity and which ever selector you are using open the expression editor and use the below
Use quotes this way
“<webctrl id='”+variable+“’ tag=‘SPAN’ aaname=‘Close Window’”

thank you

Right click on ‘ui-id-*’ and you will see options such as create variable. There you can pass your variable.

I need to get I’d from selector this ui-id-1 is in selector how can I assign from selector to variable

Oh if you are trying to get the id value you can use GetAttribute Activity and pass id as the attribute
Try this!

  1. Use get attribute
  2. from attribute dropdown, select ‘outerhtml’
  3. once you get the output for above activity, you will see that you have got selector value.
  4. Now use regex or some string manipulation to fetch index value that you want.
1 Like

Is it possible to get a valid selector if you remove ID attribute?
just check removing the “ID” attribute and see if is identifying the same control uniquely, if not check if you can add another attribute(not ID) to make it unique enough to identify the control.
once identified, use “Get Attribute” to fetch the ID and match it with regex to confirm(if required).
In short, you need to refine your selector to see which attributes would work even if you remove the ID attribute.

Regards
SG.

By using the get attribute you can handle the selector as a dynamic by passing variables