Hello,
What you can try is,
. Create a variable say $ThrowError$ of value type.
. After you validate the page is not loaded properly, inside If-EndIf block assign 'True' to $ThrowError$ variable else assign 'False' to same.
. Then using 'If Variable' command check if $ThrowError$ = 'True' then using 'Message Box' command you can throw customized error and right after that stop the task using 'Stop Task' command. The text format of commands would appear something like this,
Variable Operation : False To $ThrowError$
If Web Control Exists Then
Variable Operation : True To $ThrowError$
Else
Variable Operation : False To $ThrowError$
End If
If $ThrowError$ Equal To "True" Then
Screen Capture: Capture Window "* Windows Internet Explorer" and store in "C:\Image.png"
Send Email: Subject: "Automation Anywhere finished executing the task. with Attachment(s)"
Message Box: "Page not loaded properly. Aborting the task."
Stop The Current Task
End If
Hope that helps.
|