Inserting clipboard commands into a functional test script

During recording or editing, you can insert system clipboard commands into a functional test script. You can also insert into a functional test script a verification point test command against the active content in the system clipboard.

About this task

To insert a clipboard command into a script during recording or editing:

Procedure

  1. If recording, click the Insert Script Support Commands button Insert Script Support Commands button on the Recording Monitor toolbar.
  2. If editing:
    1. Position the pointer in the script where you want to insert the comment.
    2. On the functional testing toolbar, click the Insert Recording into Active Functional Test Script button Insert Recording into Active Functional Test Script button.
    3. On the Recording Monitor toolbar, click the Insert Script Support Commands button Insert Script Support Commands button.
  3. In the Script Support Functions dialog box, click the Clipboard tab.
  4. To insert the clipboard verification point test command into the script, select the Verification Point tab and perform the following:
    1. Type the verification point name in the VP Name field.
    2. Click the Convert Value to Regular Expression Convert Value to Regular Expression button to convert the system clipboard value to a regular expression pattern.
      This is matched at run time against the system clipboard contents.
    3. Click the Evaluate Regular Expression Evaluate Regular Expression button to evaluate the current pattern against the system clipboard contents.
      In the Evaluate Regular Expression dialog box, the Pattern and Match Against Value fields contain the current value. To try an expression, change the value in the Pattern field and click the Evaluate button. The Result indicates whether the expression matched. Click OK.
    4. Click the Insert Code button to insert the clipboard verification point command into the functional test script.
  5. You can also have clipboard text automatically pasted into an input field during test runs. To assign the clipboard text to a script variable, perform the following: and perform the following:
    1. Select the Assign Text tab
    2. Type the script Variable Name to which you want to assign the clipboard text.
    3. Select the Precede variable assignment with type declaration checkbox to precede the variable name with a string type declaration.
    4. Click the Insert Code button to insert in the functional test script the command for assigning the clipboard content into a local variable.
  6. To update the contents of the system clipboard, select the Set Text tab and perform the following steps:
    1. In the Set clipboard text to the following value field, type the value for the clipboard.
    2. Click the Insert Code button to insert into a functional test script the command for setting the content of the clipboard to the supplied value.