Read dynamic elements in webpage and click matching text

I am searching number (226342) like so:
search

Which yields multiple results like so:

The one I want to select the option that states the matching # in YELLOW like so “WO#226342”
There will always be two numbers, and the one to select is the FIRST one like so:

I will be passing multiple numbers through the search, and the results will change but the one I need to select will always have text that states:

“WO#(variable I entered)”

What is the best way to get UiPath to click the correct WO? Thanks in advance!!

2 Likes

Hi.
I think you can use ‘click text’ and handle the selector.(ex: aaname=WO#*)
And set the text like “WO#”+[your variable].

1 Like

@eonofrey
working with dynamic selectors is nowadays more comfortable:

Another strategy could be also to check if the yellow box can be incorporated into the selector via class / style information

if its becomes more tricky:
the next helping ressort could be

2 Likes

I tried this. It was able to select an option that was a WO but was not consistent with selecting the one with the correct number (my variable)

1 Like

So I followed your advice and here is what happened. The first item that was searched, the CORRECT selector was found. The second time, this happened:

wo1

And the WRONG WO# was selected… what is going wrong here?

Here is the exception:
RemoteException wrapping UiPath.Core.Activities.TextNotFoundException: Text was not found
at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance,
ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

1 Like

@eonofrey
but you know your excact wo number you want to click, right?

1 Like

@ppr

I also tried to assign to a variable. The original variable I am working with is ‘WOnumber’. I used the assign activity to convert to string and use as WOidentifier.


v2

I was unable to validate the expression.

1 Like

Yes, and it is pulling the correct WO# to the variable ‘WOnumber’ in the side panel when I am debugging.

1 Like

But after }} there is still text? So you can do }}*

can you share all fragments here as text.
the entire aaname
your variable
the selector formated with </> button

1 Like

My variables
WOnumber (GenericValue) = 221843
WOidentifier (string) = 221843

Selector

1 Like

@eonofrey
have a look on your post. Selector is empty due it was not surrounded with the preformat button orr it faild

I had a closer look to your case you need a different strategy as you are triggered by the yellow mark not by the text.

can you show for blue one and a yellow one the offered selctor tags (right side in UiExplorer)

1 Like

Here is an example of the Ui Selector for
BLUE (WHICH IS NOT WHAT WE WANT TO SELECT):

YELLOW:

I am not having any issues with the bot selecting the blue tckt. The problem I have is there are multiple search results in yellow and I cannot get the bot to consistently select the correct one that matches my variable (WOnumber/ WOidentifier)

1 Like

@eonofrey
OK now please do the Same for the yellow and blue Boxers inside the link. WE want find Out what WE can use color Trigger and looking e.g. class Name parts

1 Like

What do you mean by inside the link?

1 Like

I am intersted want to know if inside other html elements are existent. and if some markers can be found to know when it is blue when it is yellow

also an inspect element in browser and a screenshot from the structure could help. I do feel we are close to the idea of solution approach

1 Like

I was unable to find in UiPath explorer but I inspected the webpage to give us more information about where the color is determined. Here is what I found:
BLUE:
inspect1 inspect2
YELLOW:
inspect3 inspect4

1 Like

please show me all from beginning a tag till closing a tag. I cannot inspect if information is ommited. Thanks

1 Like

Some sensitive information I had to black out. Is this the entire tag you need?
inspect

1 Like

Perfect. let inspect a few mins

1 Like

can you try following:
replace in your selector the last line related to the button with:
<webctrl tag='A' class='*btn-warning*' idx='1'>

validate it and highlight it.

then in a seconde test set the idx to 2 and validate, highlight and check if the second yellow button is highlighted and is correct

2 Likes