Hi Daniel,
Thanks for the clarification, now I have a clearer picture of what you mean.
The "Operation Parameters" dialog (like the one used in the Compare Properties operation) is actually common to all keyword test operations, including those created using script extensions. To use this built-in dialog for your custom operation, you need to define the operation parameters in the description.xml file and specify the
Parameters editor for the Value column:
<KDTOperation Name="..." Category="..." Icon="...">
<Parameters>
<Parameter Name="MyParam"/>
...
</Parameters>
...
<Columns>
<Column Name="Value" Editable="True" EditorType="Parameters"/>
...
</Columns>
</KDTOperation>
In this case, when the user adds the operation to the test or clicks the ellipsis button in the Parameters column, TestComplete will pop up the standard Operation Parameters dialog where the user can select test parameters or variables among other values.
In the script extension code, you can access the run-time values of the operation parameters (whether they are hard-coded or specified using test parameters or variables) via Parameters.
ParamName. For more infromation, please see the
Implementing Parameters Editor section of the
Implementing In-Place Editing Support article.
If you wish, you can also create a custom configuration form for your operation in addition to using the standard Operation Parameters dialog. (See
Creating the Operation Setup Routine.) You might want to do this to make use of special edit components, such as TcxCheckBox for boolean values, TcxSpinEdit for numbers, TcxComboBox for option lists, and so on.
Your custom configuration form will be displayed
before the Operation Parameters dialog. However, while users can enter parameter values using check boxes, combo boxes and other controls you've added, they won't be able to select test parameters or variables here, because you can't access them from script extensions. It's considered an "advanced" feature that is only available in the Operation Parameters dialog shown after your custom form. So, if users want to select a test parameter or variable, they can close your custom form and proceed to the Operation Parameters dialog.
And the last thing. What if the user previously selected a test variable or parameter for the operation and then invokes the configuration dialog? Since you can't display test parameters and variables in your custom edit form, you need to skip it and display the standard Operation Parameters dialog instead. To do this, your OnSetup event handler should first call
aqObject.GetVarType to check the stored parameter types - in case of test parameters or variables, it's varEmpty. So, if one or more stored parameter types are varEmpty, you need to skip the code.
Since script extensions can't directly access test parameters and variables, you can't display them in custom edit forms. However, what if the user previously selected them in the standard Operation Parameters dialog? In this case, your OnSetup event handler should first call aqObject.GetVarType to check the stored parameter types - in case of test parameters or variables it will be varEmpty. If so, you need to skip the code related to your custom configuration form. Check out the first example in the
Creating the Operation Setup Routine article for an example of how to do this.
Hope this helps!