Occurs during test recording to check whether a particular piece of recorded script is equivalent to the operation.
Custom keyword test operations created with script extensions can be recorded just like standard operations. To enable this, the operation developer needs to implement the
OnGenerate event handlers.
TestComplete records tests as script code and then converts this code to the appropriate keyword test operations. The
IsSupported event occurs when TestComplete checks if a particular piece of recorded script can be replaced by the given operation. The event handler should parse the specified code and return True if it matches operation and False otherwise.
IsSupported event handler returned True for a particular code snippet, the
OnGenerate event is then raised to generate an operation instance corresponding to that code.
A typical implementation of the
IsSupported routine performs the following actions:
Syntax.CurrentLanguageproperty to determine the scripting language currently in use.
Checks if the Code string matches the operation’s scripting equivalent in the appropriate language. You could perform such a check using regular expressions.
The event has one parameter:
True, if the specified script code is equivalent to the operation; otherwise False.
IsSupported event handlers of several operations return True for the same code snippet, TestComplete records the operation that has higher priority. By default, standard operations of the Checkpoints category have the highest priority.
|Be careful when implementing the