Use Try/Catch for popup window from system internal?

Sometime during the run uipath , It appear popup system internal I want to click close.

How to setting Try/Catch for solve it.?

1 Like

Hey @Maria99

Are you talking about an error popup from UiPath or an app/system you are automating ?

#nK

@Nithinkrishna popup from My app.

1 Like

Great, So also could you please confirm the outcome for the scenario when popup occurs ?

Throw an error or just close it ?

@Nithinkrishna Click close it.

1 Like

Great and after closing you will be continuing the steps right ?

@yes, after close it continue flow uipath.

1 Like

And do you know at what step the popup occurs and the no. of times it occurs ?

@Nithinkrishna Don’t know. Sometimes show popup , sometimes don’t show

1 Like

Great, We can follow two approaches here

  1. Parallel activity

     Here you need to use a parallel activity
    
     One side of the parallel activity will be your actual business logic flow which you already have
    
     Other side one more sequence with logic to handle the popup 
    
  2. Global exception handler

     In this case whenever there is a popup there will be a system exception captured where it will hit this and you can just handle popup and continue the execution by retrying the activity which thrown system exception
    

#nK

@Nithinkrishna It I use Global exception handler.

What should I use in catches exception?

1 Like

This is try catch right

1 Like

@Nithinkrishna yes.

image

1 Like

With try catch you can’t continue the flow when a popup comes instead you can stop your flow with the error.

To use global exception handler, you need to click on the new on top left and select Global Exception Handler

@Nithinkrishna ok, How to setting in Global Exception Handler ?

1 Like

Great, After the log. You need to check if your popup exists using Element Exist activity and do click on ok or something which closes the popup.

And then just add retry to the assign at the end.

@Nithinkrishna Right ?

1 Like

Perfect @Maria99 in the else just add continue same as retry assign.

Comment the below default if block pls

@Nithinkrishna right?

If show popup in workflow plugin it click close auto right?

1 Like

In the else block assign value, instead of retry just use continue.

Hope this should work.

I’m assuming you have commented or removed the default if block which was already present.

1 Like