How to Recognize An Alert from App Error Handling

alerts

#1

I have an automation to entry customer data to an application.
The application has their own error handling, and I want the automation to go along with them.

For example, I want the automation to click Reset Button when there is an alert box saying there’s an error in the data. My question is, what is the best practice to recognize an alert box?

Should I add a Find Image activity after click Save Button, and then wait about 3 seconds to see if there’s an error alert?


#2

@whyyouandi

Try Element Exist activity to find whether the alert box is present or not . The activity returns Boolean value, based on the output you can perform the respected task. Set the timeout as per the convenience.


#3

Thank you for your kind response, @ranjith.

I got it Element Exists is more appropriate than Image Exists.
However, been wondering if this is the best practice to do this?

I really don’t understand automation (sorry for rambling).
For example, I set 3s as timeout.
How about if the error gets slower than it should and the error pops up after I was entrying another data? Seems I have to break the process with Kill Process on the Catch (when I use Try-Catch)?


#4

@whyyouandi

If you expect that pop up will rise at uncertain intervals then try to increase the timeout to 10 secs or ever higher . As soon the pop up appears Element Exist would return true within the timeout. Only concern is when it takes more time or doesn’t occur then we have time constraint.

If pop occurs after the timeout then you have to go with Exception Handling mechanisms(Try/Catch) as you said. You are the person who knows about the process ,construct the exception handling as per your needs.


#5

@ranjith thank you for your continuous response.
So it seems like there is no best practice in automation, but a best application within a project. Thank you!