In this tutorial, we will create a script extension that will assist users in creating the clipboard checkpoint. The extension will include both the record-time and design-time actions, since checkpoints can be created both during the test recording and at design time.
The record-time action will perform the following actions:
-
Obtain the current clipboard contents.
-
Generate the comparison code using the current contents.
-
Insert the generated code into the recorded script.
The design-time action will do the following:
-
Obtain the current clipboard contents.
-
Generate the comparison code using the current contents.
-
Show a dialog where the user will copy the code and insert it into their script. We will create the dialog and invoke it from the script extension’s code.
Both actions should be able to generate comparison code for any scripting language supported by TestComplete.
TestComplete adds the record-time actions to the Recording toolbar and the design-time actions to the Tools toolbar:
Script Extensions on the Recording Toolbar
Script Extensions on the Tools Toolbar
So, we will have to create an icon for the toolbar items.
Also, we will create the description.xml file that contains information about the extension and is used to install the extension into TestComplete.
See Also
Script Extensions Tutorials
Script Extensions
Clipboard Checkpoints