Try Catch Activity To handle different pop-ups of an application

Hi I am fairly new to UiPath.

I have been experimenting with Try Catch activity for exception handling. Built a UiPath process that reads an excel file and writes into a web application. Problem arises when on the webapplication page different pop ups appear and can’t proceed until the popups are handled.

Following are the pop ups:
image
OR
image

Popup that says no changes are made appears when tool reads and writes without changing any existing values of the webapplication.

Second pop up which says do you want to make changes to existing entity occurs when a value has been changed in the excel which is different to existing values.

We don’t know when we will get first pop up and when we will get the second pop, its all depended on whether or not the value read from the excel will change existing values of the webapplication.

To handle this pop up situation I was experimenting with Try Catch in the Try Section I was adding first pop up in the exception section I added system exception and added second pop up activity and in the final section I added steps that happen after the pop ups appear.

But it does not seem to be working getting following error:
image.

Am I using try catch block wrong?

Any feedback, tips are highly appreciated.

Regards,
Abhishek

1 Like

Well it looks fine
I believe u r running in debug mode
Run in normal mode and try

Under play Hutton u can see option like run file, run project, debug project

Click on run file or run project

Let us know if u r facing challenge still

And with error that appears make sure the element is visible that the failed activity is referring to as it states that element is not visible

Cheers @abhishek.singh4

Hi @abhishek.singh4 ,

If there are no other Try Catch or Exception handling done in the workflow, then as you have added the Second Pop Up Handling in the Exception section, if it gives out an Error it throws up the Error like provided in your Screenshot, Also the same goes for the activities present in the Finally block as well.

We would like to know if there was a Top Level Exception handling performed or Global Exception Handling done.

Also, Double check on the Selectors used for the Popups, it might not be able to recognise the Popups and thus give out the errors.

You wouldn’t use Try for this. You need to use Check App State to look for the popup. Use a separate Check App State for each popup because they’ll have different selectors.

Hi Paul,

I tried your suggested method and added app state activity to handle pop ups. But get following error.
image

This error appears if the indicated element does not appear. So to handle it in the target does not appear section I added another check app state but I get the same error.

Am I doing something wrong?

You use the Check App State to look for the popup. In the “Target Appears” section you add the steps to clear the popup (ie click YES). You may need to use a Use Application/Browser to attach to the popup and put the click inside it.

In the “Target does not appear” section you do nothing, you can just click the toggle to hide that section, or you can do a Log Message indicating the popup did not appear.

Hi Paul,

Seems like UiPath is mistaking both the pop ups as the same type of pop up. Example: First pop up which is a question has Yes and No option that we can click but the second pop up that is a message box and appears when no changes have been made has only one choice i.e ok.

So if the second pop up appears instead of executing activities in target does not appear block, it is looking to click the yes button from the target appears block of check app state.

Then set the Check App State to look for the Yes button. If the Yes button is there, you click it. For the other one, set it to check for the Ok button, and click it.

Hi, I used a different method to handle pop ups which was through hotkey. Didn’t matter what popup appear, I just added hotkey to handle all the popups and that solved my issue without having to use try catch.

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