I have an element with the attributes:
<wnd app='...' ctrlname='....' />
<ctrl name= 'grid' role='table' />
<ctrl name= 'Row 3' role='row' />
<ctrl name = 'username' role='cell' />
As u can see the ‘name’ attribute is not unique, how can I get the value ‘Row 3’?
Could you please try below steps.
→ use ui explorer and remove the unwanted attributes. after remove please highlight and see it is still pointing out the desired ui element.
→ Now use get attribute activity and use ‘name’ as input to get the Row3 value.
just a thought not sure it works in your scenario.
Thank u, I tried but it’s not working
I use find element before and getting the same element, with the same name attributes, so when I’m trying to get attribute activity it returns the first “name”.
are you able to share website or page you are referring or is it your internal site. i will try at my end.
Hi @Shoosha ,
Can’t you uncheck the selector and just keep the Row 3 selector and try with attribute name.
Yeah i told the same suggestion but @Shoosha told it is not working. any other thoughts on this.
We can try with FIND CHILDREN ACTIVITY and use find descendants as scope property and get the output variable
Use a For each activity and pass the above output variable as input and change the type argument as UiPath.Core.UiElement in the property panel
inside the loop use GET ATTRIBUTE activity where pass the variable item.ToString to the property Element in the property panel of get attribute activity
now in the get attribute activity we can mention as “name” and get the output with a variable of type string named str_output
For more details on how to use it
- Get Ancestor:
You can use get ancestor activity for the element username, it will return a ui element.
- Get Attribute:
Pass the ui element got in previous step to UiElement property in Target section of Get attribute activity, select the attribute as name.
You should be able to get Row3 as output.
Let me know if it works.
Try you can find the value using find children activity
You can watch this video to know how find children activity works
First of all, tnx. Unfortunately I can not share because of company values
I really appreciate your help!
I tried in a different way- it was a data table and I extracted the info from it to a DT var, and then got the specific info from it, and it worked!
Hi @Shoosha ,
Thanks for sharing the solution. please elaborate your solution so that it would help others who are facing the similar kind of issue. thanks again.
Thanks to everyone for the help!
You have given here some ideas that seem right, I did not have time yet to test them all,
but they opened up for me thinking directions of a solution.
In my case it was a data table that I wanted to get a specific value from a row, luckily this row had a key so I extracted the info from it to a DT var, and then ran a for each row loop, and looked for the specific data from this row and it worked.
Not the ultimate solution for this question but in my case it worked.
Thank u for the ideas! I’ll try that. @Boopathi.M @Manan_Narang @Palaniyappan