Possible error messages - If statement - Anticipating to errors

Hey there! I’m running a bot using Excel and Workday. Basically I need to input some Excel information into workday, but some rows don’t have information associated and an error message might pop up. I know I need to create an if statement indicating that an error might appear, I’m not sure how to do it. I used the find element activity to detect the error and when the error doesn’t appear the bot stops, I want to introduce this into an if statement indicating that if the element exists (meaning, the error) it should do something but since I need the error to be detected in order to execute the if statement, it isn’t working. Any help is highly appreciate it

@Daniela_Valdez_Luis

You can use Element Exists and declare a variable example popupExist
and use If condition as popuExist

Then-> write your logic
Else-> you can keep blank

So this will work only when the popup is appeared

Hope this will help you

Thanks

1 Like

Srini’s solution might work.
A more common solution is also to use error handling.

This will aid to catch any occuring error if you can’t be specific enough by using a Element Exist in an if statement. So a lot more usefull if more unpredictable errors occur.

Thanks! I went with this approach and its a little too time consuming, do you have a way of optimizing it?

The default timeout is 30 seconds, which is 30,000 milliseconds. You may adjust the timeout value to a smaller number to reducing running time. You can change timeout value for any of your UI related activities.

Below is a screenshot for “Element Exists” activity for your reference.

@Daniela_Valdez_Luis

As @liu_shubin said the default time 30 seconds, if you want to decrease you can set the timeout in the properties, if you want 20 seconds then you can input 2000 as you need to provide in milliseconds

Hope this may help you

Thanks

1 Like

It does! I appreciate it! Thanks

1 Like

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