How do I take different actions depending on what screen comes up?

I am new to UiPath. I am accessing a web page and entering a part number in the search field. If the part number is valid, I want to grab the part name and description that appear; else the screen blanks out and a “Not found” message appears that I want to log. What’s the best way to determine if I have a good part number or a bad one? An If/Else activity seems appropriate, but what would be the condition?

you can use element exists with if activity, or if you use classic or check app state in case using modern

@bgode,

Use Check App State activity like this.

Sample code:
Test1.zip (7.6 KB)

Thanks,
Ashok :slight_smile:

The Check App State worked great! Thank you!

@bgode,

Glad it helped. Please Mark my answer as solution so it will be helpful to other community members.

Thanks,
Ashok :slightly_smiling_face:

You can use a condition inside an If/Else activity to check for part information on a page. For example, you can check that elements with a description and part name are present on the page based on their selectors or text values. If these elements are present, consider the part number found. If the page is cleared and the message “Not found” appears, this will be considered the absence of the necessary information, and you will be able to log this event.

You’d use Check App State to look for the Not Found message. If you’re new I suggest doing the free training at academy.uipath.com

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