Get text for dynamically changing UI Elements

uiautomation
studio

#1

Hi everybody,

Before I start, I need to say I’ve looked up the community before for similar issues and I couldn’t find anything that would indeed solve my problem.

Simular issue: How to get text from browser UI Element where the selector properties are dynamic(changing everytime)?

When I tried the solution above, I got the following error:

image

So I tried increasing delay/changing TimeoutMS but had no success.


I am trying to get text value from a form in web application whose html properties are dymically chaging.

This a part of my form:
image

I need the value (on the right side) from each title on the left side.
Now it’s how UIPath reads it:

if you notice, the IDs have a “gen” prefix which means “generated”, thus everytime the page is refreshed the number after “gen” changes - which means the id is not reliable.

I need to perform this action inside a “for each row sequence” because I get a new form for each person on the list I have.

Debbuging my robot on UIPath Studio I can see the values for the first “row” in the loop are correct. However, for all others it gets blank values - I assume because the IDs have changed at this point.

After exhausting my attemps with UIExplorer, I’ve tried Screen Scrapping but the outcome was even worse. The page is so poorly designed that UIPath won’t even recognise the form as a “table”.


The other solution I’ve given some thought is: getting the title element which seems to have a realible ID.
Ex: image

And trying to get the form value from there. If you notice, “aaname” is the same as the actual name displayed on the form.

Is there any way I can accomplish this? Bear in mind, it is a Span tag - so I’m not sure if I can interpret this as a hierarchy and use “get children” activity for example.

I hope someone can help me!

Thanks.


#2

HI @FlpVsg,

if suppose dynamic value keep as ‘*’ instead of giving value else don’t use that.
while seeing the image
you can remove aaname
use like this -> parentid='ext-gen*'

you can add parentclass

Try to check tableRow is unique or not

Regards,
Arivu


#3

As Arivu96 said edit the id with wildcard character ‘*’ and retry .
Do post your feedback weather its working fine or not.

Thanks.


#4

Hi @arivu96 @balu,

I’ve managed to work around this issue using Get Ancestor and Find Children, since the form on the website follows the same structure:

image

However, it gets me into another problem.

image

For the form above, I can get the value of “Matrícula” for example.
And I could manually repeat the process for “Companhia” and “Filial” - because the “Get Ancestor” element would change for each field.
E.g.:
image

The only thing that would change would be “aaname”.
Having that in mind, I tried creating a String Array initialised with all “aanames” I would need.
In this case, “Matricula”, “Companhia” and “Filial”. Then I would insert those values in a variable and use that variable in my Selector on each iteration.

The problem is: although it displays the Selector properly on my Output (because I print it before actually using it) it doesn’t find the element on the page. I tried selecting the element manually again and the Selector string is the same as the string with the variable.

E.g.:

String generated when selecting element on screen:

image

String generated when using variable:

image

They look the same, right? But somehow, it only works using the first one.

Any suggestions?


#5

Hello,

It’s all sorted out!

Thanks.