Customizing KeywordTest Editor Contents

Applies to TestComplete 14.70, last modified on April 22, 2021

The Keyword Test editor lists all operations included in a keyword test and displays various information about them, such as the operation name, type, description and parameter values. This topic explains how you can provide the Keyword Test editor with information on custom keyword test operations created with script extensions.

Information about a custom operation that is displayed in the Keyword Test editor is defined in the script extension’s description file. Namely, in the child Columns element of the KDTOperation element corresponding to the operation. The Columns element is a container of Column elements that correspond to various columns of the Keyword Test editor’s Test Steps page. The Name attribute of the Column element identifies the editor’s column that the element matches:

XML

[description.xml]


<KDTOperation>
  …
  <Columns>
    <Column Name="Item" … />
    <Column Name="Operation" … />
    <Column Name="Value" …/>
    <Column Name="Description" …/>
  </Columns>
  …
</KDTOperation>

The image below illustrates the correspondence between columns of the Keyword Test editor and the Column elements:

By default, the Keyword Test editor does not display any information on custom operations; it only shows the operation icon (if any). To fill in a particular column, you should do the following:

  1. Add the Column element with the appropriate Name attribute value to the description.xml file.

  2. Specify one of the following attributes for the Column element:

    • Value - Holds the text to be displayed in the column. This text cannot be modified.

    -- or --

    • GetValue - Holds the name of the script routine that returns the text to be displayed in the column. You can use this attribute if the column contents should be generated on-the-fly.

Tip: To display the list of operation parameters in the Value column, set the EditorType attribute of the corresponding Column element to Parameters, instead of using the Value or GetValue attributes. In this case, the Keyword Test editor will manage the contents of the Value column itself. For more information, see Implementing In-Place Editing Support.

The following example illustrates how you can specify the operation data to be displayed in the Keyword Test editor. It defines the contents of the editor’s Item and Description columns. At that, the Item text is hard-coded, whereas the Description text is retrieved from the operation’s internal Description field:

description.xml

...
<KDTOperation Name="My Operation">
  <Data>
    <Field Name="Description" DefaultValue="A custom keyword test operation." />
  </Data>
  <Columns>
    <Column Name="Item" Value="My Operation" />
    <Column Name="Description" GetValue="MyOperation_GetDescription" />
  </Columns>
</KDTOperation>
...

JScript

function MyOperation_GetDescription(Data)
{
  return Data.Description;
}

VBScript

Function MyOperation_GetDescription(Data)
  MyOperation_GetDescription = Data.Description
End Function

See Also

About Keyword Test Editor
Creating Keyword Test Operations
Creating Keyword Test Operations - Basic Concepts
Implementing In-Place Editing Support
Structure of the Description File

Highlight search results