Occurs when a new instance of the operation is created during test recording.
Declaration
| Code | [in] | Required | String | |
| Data | [in] | Required | Object | |
| Parameters | [in] | Optional | Object |
Description
The OnGenerate event occurs during test recording if the operation’s IsSupported event handler returned True for a particular piece of recorded script. In this case, TestComplete creates a new instance of the operation and then raises the OnGenerate event in order to initialize the operation parameters with values held in the recorded code.
A typical implementation of the OnGenerate event handler performs the following actions:
-
Uses the
Syntax.CurrentLanguageproperty to determine the scripting language currently in use. -
Parses the specified script code and retrieves values corresponding to the operation parameters. You can use regular expressions for this purpose.
-
Initializes the operation parameters and internal fields with values retrieved from the script code.
Parameters
The event has the following parameters:
Code
Syntax.CurrentLanguage property.Data
Parameters
An object that provides access to the operation parameters. This object contains properties that correspond to individual operation parameters and whose names coincide with the parameter names.
Note for VBScript users: If the operation does not have parameters, this argument must be absent in the event handler’s arguments list.
See Also
Events Reference
IsSupported Event
OnCreate Event
CurrentLanguage Property
Creating Keyword Test Operations
