Calling a script from a functional test script
While recording or editing a functional test script, you can insert a call to a previously recorded script. This lets you avoid repeatedly recording similar actions on the application-under-test by taking advantage of scripts that already exist.
Procedure
- If recording, click the Insert Script Support Commands button
on the Recording Monitor
toolbar.
If editing:
- Position the pointer in the script where you want to place the callScript command.
- Click the Insert Recording into Active Functional Test Script button on the product toolbar.
- Click the Insert Script Support Commands button on the Recording Monitor toolbar.
- Click the Call Script tab in the Script Support Functions .
- In the Script Name field, select from the list the name of the script you want to call or enter the name.
- In the dataset Iterator Count field, do
one of the following:
- Type or select the number of records in the dataset.
- Select Iterate Until Done to access all records in the dataset.
- Select Use Current Record to use the same record across the call script.
- Click Insert Code.
Test UI inserts the
callScript ("scriptname")
code at the cursor location, where scriptname is the name you selected in the Script Name field. - Click Close to remove the Script Support
Functions dialog from the screen.Note: You can also insert one or more callScript commands from the Functional Test Projects view .