How to handle "not found" on a home, with a "Get Text" activity

I have list of numbers in an Excel sheet which I would like to verify on a home page. It goes very fine when “found”, but how to handle “not found”?

I use “For each Excel Row” to find next number in Excel sheet.
Then “Type Into” to get the homepage to verify the number.
Finally I search the homepage for the string “Serial Number” with the “Get Text” activity
when found I update the excel sheet for the current row.
And next number.

The problem is when the number is not found, then the homepage shows “Not found” and the program stop, due to it can’t find “Serial Number”.
I would be happy if the program just tried with next number.

I’m missing and "If… then… " in the “Get Text”

What to do?

HI @JesperRed

Welcome to Uipath community

You can use Try catch activity to handle.

Inside the Try block Use Get Text activity | Store the Output as GetvalueData

image

In the Catch Block

Use Assign activity

LHS = GetvalueData
RHS = ""

image

After that Use If condition

not String.IsNullOrEmpty(GetvalueData)

Regards
Gokul

you can use Check App State activity where you add the condition to run if found and add continue if not

(post deleted by author)

Hi Gokul
Thanks for your very fast reply. I’m using UiPath StudioX (trial).
I can’t find the activity “Try Catch” does that require a special license or am I simply blind?
/Jesper Red

Hi firas
Also thank you for fast reply. Very nice activity “Check App Status”.
But the result seems more or less strange. It either react as Target appears for all rows or does not appear again for all rows. (Some should be found some not)

I’m looking for a specific text string. Any good suggestions?

1 Like

Hi,

We can use dynamic selector to check if the target contains specific keyword as the following. Can you try this?

Sample20221108-3.zip (10.8 KB)

Regards,

Hi,

Sorry, you use StudioX. We can do same things in StudioX, too. Can you try the following?

Sample20221108-3X.zip (58.0 KB)

Regards,

Hi Firas
Thanks for you help. It works very well now.

1 Like

Hi Yoichi Thanks for your help now it works

1 Like

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