GetLastError Statement
Description
Returns the error code of the most recent error. You can use this statement together with the DescribeResult Statement.
Syntax
GetLastError
Return Value
Number

In the following example, the script fails to run successfully because the Sign-in button was not found on the Advantage Online Shopping page. Using the GetLastError function, the error number and description are inserted into a message box.
Browser("Advantage Shopping").Page("Advantage Shopping").WebButton("sign_in_btnundefined").Click 19, 55
x = GetLastError
msgbox(DescribeResult(x))
See also: