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
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
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:
- CallServiceTest Statement
- CreateObject64 Statement
- DescribeResult Statement
- ExecuteFile Statement
- ExitAction Statement
- ExitActionIteration Statement
- ExitComponent Statement
- ExitComponentIteration Statement
- ExitTest Statement
- ExitTestIteration Statement
- GetLastError Statement
- InvokeApplication Statement
- IsPartialRun Statement
- LoadAndRunAction Statement
- LoadFunctionLibrary Statement
- ManualStep Statement
- Print Statement
- RegisterUserFunc Statement
- RunAPITest Statement
- SetLastError Statement
- UnregisterUserFunc Statement
- Wait Statement