When Same Exception Occur in two different scenarios, how to handle that exception

Hi,
I am running a continues dropdown selection from a data table.
Same error occur, when item is not available in the data table and when bot can not find the Ui element in the screen.

How to handle above error ???

for a quick defensive check, an element exists activity can help for prechecking if the item is available or not

For evaluation against the values contained in a dropdown we can use:

  • find children to get all dropdown options items

Afterward a postprocessing of the found options can be done for any other consolidations/evaluations

Try/Catch is how you handle exceptions. You should not be seeing the same error from a datatable operation vs UI automation.

Show your code and explain what you’re trying to do. You can paste screenshots directly into your reply. Make sure you show the exact exceptions.

Hi,

I have prepared a problem analysis document. Kindly review the two scenarios.

Thank you,
Ruvinda
Problem Analysis Document - RPA .pdf (357.2 KB)

Hi Paul,

Thank you for the answer.
Problem Analysis Document - RPA .pdf (357.2 KB)
Kindly review this.

Thank you,
Ruvinda

provide a default value to the used variable from the dynamic selector when it is validated stand alone

deriving decisions from a try/catch is not recommended

Dear Peter,

Thank you very much for your reply. Can you kindly more elaborate on this. Then I can test it from my end.

Thank you,
Ruvinda