Handling the exception

Hi Guys,

Currently when my BOT runs and if it doesn’t find an element it logs and exception but i want my BOT to handle this “selector not found” exception rather than logging it.
How it can be achieved?

@somya177 - Is the element not available because UiPath is unable to find it or is it due to the way the application behaves?

uipath is unable to find it

@somya177 - How do you want to handle it?

maybe by giving a retry or refresh page and then find it.
How this coding can be done? so that my BOT should not stop or throw any error.

@somya177 - I would not suggest to handle that scenario in this way. Because then you need to ensure that the bot does not go in a loop trying to find the element. So you will need to limit the number of retries using a counter. Instead of this, try to find a way to get the selector of this element. Did you try using the UiExplorer to find the element?

yes…actually can u share me asample demo where you have handled any sort of exception.will get a fair idea then

Use Try Catch activity.

1 Like

Hi @somya177 ,

Please have a look at this workflow to handle this exception using a try catch activity. Handle_Exception.xaml (6.7 KB)

Warm regards,

1 Like