How to Handle Exception for dropdown

HI,
I have a dropdown list with some values inside it. I m reading the values from excel and using select item its working fine. but what if the excel column contains the value(i.e negetive data) that are not present in the drop down list. the automation stuck there itself and throwing an exception. How to handle such exception???

Hi @Abhishek14

For the Select Item activity you can always handle the exception.

  1. If you want to continue even exception raises then in Select Item Activity property “ContinueonError” option to True.

  2. If you want to take action then surround that in a Try Catch and in Catch you can place your actions

Eg: You can put a select Item activity in Catch and select a default value

Hope this helps

Thanks

You can use try catch, first add a column to your Datatable of name “Status” then whenever you find the the value in the dropdown set the status as “Found” and if you don’t find the value then update the status column as “Not Found”.
Activity will throw error whenever it doesn’t find the value, in catch section update the status column as “Not Found” and put your activitiy in the try section.

Can we use global exception handler to handle the exception. for all dropdowns in a application.