SetLastError Statement
Description
Inserts a VBScript error into the test script.
Syntax
SetLastError(Error)
Argument | Type | Description |
---|---|---|
Error | Integer | The error. |

The following example uses the SetLastError function to place the "Out of memory" error into the test script. For a list of VBScript errors, see the online Microsoft VBScript Language Reference.
Browser("Advantage Shopping").Page("Advantage Shopping").WebCheckBox("remember_me").Set "ON"
SetLastError(7)
Browser("Advantage Shopping_2").Page("Advantage Shopping").Link("UserMenu").Click
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