How to get element index value using Get attribute activity?

Hi All,

I want get the element index value like in below screen using get attribute activity and use that value later.

I don’t have index or idx option in get attribute drop down list

I tried by giving “idx” like below but no use

image

Can someone please help me in this ?

@ppr

idx is not an actual property of UI elements. It’s a UiPath thing that it adds to a selector when the selector isn’t unique enough. You should avoid using idx at all costs, as it can easily change and break your selector. The worst part is it often won’t know the selector is now wrong, it’ll just grab the wrong UI element.

What you need to do is open the selector in UI Explorer and add additional properties to make it unique.

Only unique property I have is idx in UI explorer

As per UiPath Best practice do not use the “Idx” or “Id” based selector as its keep changing, its recommended that you use the without “id” selectors.

image

idx is not an actual property of UI elements that’s why you can’t see this in to the property
@Mandava_Naresh pls note

pls click on the “Open in UI Explorer” to identify more attributes or tags.

we would recommend to resharpen the requirements. Maybe you can elaborate more on the details and tell how a human would identify the element.

Also, have a look find children. Maybe it can help for the element identification from an uielement series.

@Mandava_Naresh

If you get the full selector also you can use it later exactly…

Also as mentioned by @ppr you can use find children to get the prent or the child or it and all as well

Cheers

Indicate it in UI Explorer and post a screenshot of the upper right pane, like this:

Also, by selecting additional parent elements you can make the selector unique:

Lastly, you should be working in modern so you can use anchors to help UiPath uniquely identify the target element.

Hi ,

Please find below

I have to click + and select the value from drop down and give value …this happens for 3k records in loop (
idx changing everytime )

These are all properties you can check add to the selector to make it unique so that idx is not needed.