Problem getting text values

Hello,
I have a set of lots of fields (name, birth date, sex…). The only difference in the selectors is just the “idx” indicating the order of such a field:

image

What could I do in order to get the proper value (just in case other fields are added and then the number of the text previously got does not coincide) ?

2 Likes

Have you tried to open your selector in UiExplorer?

May be you can get more attributes in right side panel of UiExplorer.

3 Likes

Hey @EngAnalyst,

Check in the UiPath Explorer to see whether you can grab some other attribute in the selector like aaname or innertext or something else which is easily distinguishable.

If the other attributes are not available then the only choice you are left with is to use the idx attribute dynamically.Then in that case you need to derive a logic to pass the variable value in the idx attribute.

2 Likes

Hi @EngAnalyst,
1.First check in the UI Explorer if there is any attributes like aaname or inner text.
2.If not there make your selector as dynamic, by using like this,
Remove the id number and make it as *
EG: id=’*’.
This makes the selector to select the element with any id value and keep some unique attribute.
I hope this will work,If useful mark it as solution.
Cheers

2 Likes

Vashisht I can not do this since all the fields have the same selector except for the idx number. If I set idx=’*’ then the robot will not know what is the field I want to get.

2 Likes

Vashisht What kind of logic could I use?

2 Likes

Yes, and all the fields have the same selector attributes except for the idx number.

2 Likes

Hey @EngAnalyst,

Can you give me some more insights?

What kind of ui element you are trying to click and which activity you are suing to click.

2 Likes

@amarasto I have something similar like this:
image
The only difference in the whole selector is just the idx number.
I am using anchor base (find text position + find element) and it works properly to make a difference between Email and Name. However, i do not know how to get the second field of the first name…

2 Likes

Did you check in UI explorer for some unselected attributes. You will find some attributes which may be unique.
Once try to validate when validated copy paste in notepad and then run.
When not validated check the selector copy paste it again near old one and check what is the difference.
Cheers

2 Likes

I have done so and the selectors are exactly equal…

2 Likes

Yeah Good i also thought of suggesting the anchor base.
1.You can go to the second field by using the send hotkey activity and keep tab in send hotkey activity.
2.Then use the type into activity then it works.
If you find this useful mark it as solution and close the thread.
Any issues let me know buddy.
Cheers
Vashisht.

2 Likes

hello @EngAnalyst
could you try to find first field of firstname position + find element for second field

Thanks

2 Likes

Hey @EngAnalyst,
Have you tried using Anchor Base.Give it a try.

2 Likes

Vashisht
sandeep13
What about getting the idx of the first name field and then use sth that allows to get the text of the idx+1 element?

4 Likes

@EngAnalyst

may be that work. you try this??

Thanks

2 Likes

Yeah try it and let me know bro…

2 Likes

Vashisht
sandeep13
I ’ ve tried but it is not solved… I can not get the idx…

2 Likes

hello @EngAnalyst

are you getting different idx value for different Textbox. right?/

Can you give any sample to work on so that i can solve it?

1 Like