How to get idx in specific parent by element

I’m working with a label tree in java program
something like this, the labels in same level are share the same name, the numbering just for easier to explain:
Label A1
Label B1
Label A2
Label B2
Label B3
Label C1
Label A3
Label B4

Then I am able to get specific element(let say Label C1) with selector like:
<Label A idx=‘2’><Label B idx=‘2’><Label C idx=‘1’>

but how can I get the idx of this element as a label in the whole TREE? the idx of it should be ‘6’ in this case

sorry about the formatting, the tree should be like this:
image

@CTC
welcome to the forum

in such scenario, we can check, if we can use find children activity to get All or particular labels and can process the retrieval result

oh, I see, thank you

@CTC

Welcome to forums

Idx you can follow as @ppr suggest

But you can also search for another tags because Idx is only be used if there are no other tags available

Hope this will help you

Thanks

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