Occurs when a new instance of the operation is created during test recording.
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:
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.
The event has the following 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.