Parameterize scripts

Parameterizing a script is to replace constant values in the script with parameters. This allows you to re-use steps and create more flexible scripts.

Overview

You can use input parameters to parameterize step input values and AI object names. You can use output parameters to store step output values.

A parameter is a variable that is assigned a value. FT Design supports only String type parameter values.

The following sections describe how to create and use parameters:

Back to top

Create and manage parameters

In the Script parameters pane, you can create an input or output parameter, edit the default value of an input parameter, or delete a parameter.

You can create all required parameters in advance in the Script parameters pane, and then add them to steps, or you can create parameters when you need them in a step.

To create an input or output parameter:

  1. In the upper right corner, click the @ icon.

    The Script parameters pane opens.

  2. Click + Create new.

    The Add New Input/Output Parameter dialog box opens

  3. Enter an unique parameter name. For input parameters, define a default value.

    When you name a parameter, consider the following restrictions:

    • Case-sensitive

    • Must begin with a letter

    • Cannot contain spaces

    • Cannot contain the following characters: ! @ # $ % ^ & * ( ) + = [ ] \ { } | ; ' : " , . / < >

To manage parameters:

  1. To edit an input or output parameter, select an input or output parameter and click the Edit icon to modify the parameter name or value.

    When you change the name of a parameter, the parameter name in all the step lines that use this parameter is changed accordingly.

  2. To delete an input or output parameter, select a parameter and click the Delete icon.

    If the parameter is used by your script, after it is deleted, the step lines that reference the parameter are marked as invalid.

  3. To use an input or output parameter in your script, see Use parameters in the Editor and Use parameters in the step editing pane.

Back to top

Use parameters in the Editor

While you are editing a script, you can directly use input parameters to pass values into your steps or save values into output parameters in the Editor.

To use an input parameter:

  1. Open a codeless automation script.

  2. Select a step in which to add an input parameter.

  3. Hover over the value or object name and click the drop down arrow.

  4. In the pop-up window, select an input parameter you created before. If you haven't defined any parameter, click + New Parameter to create a new input parameter.

    The constant value in the step is automatically changed to the added parameter.

  5. To convert back to the original constant value, hover over the parameter and move the Use Input Parameter switch to off state.

    Note: When you type @ in the step line, a pop-up window opens for you to create or select an input parameter.

To save a value in an output parameter:

You can pass a constant value, the value of an input parameter, or the value of an AI object into an output parameter.

To pass... Type...
a constant value

Set "value" into @<output parameter name>

the value of an input parameter

Set @<input parameter name> into @<output parameter name>

the value of an AI object

Type one of the following syntax:

  • Set value of '<text for identification>' <control type> into @<output parameter name>

  • Set '<text for identification>' <control type> value into @<output parameter name>

When you type @ in the step line, a pop-up window opens for you to create or select an output parameter, as shown below:

Back to top

Use parameters in the step editing pane

When editing a step in the step editing pane, you can select whether to use a constant value or an input parameter as the object name or the step value.

To use an input parameter:

  1. Open a codeless automation script.

  2. Select a step in which to add an input parameter.

  3. In the step editing pane, click the icon next to the Text identification or Value input box.

  4. In the pop-up window, select an input parameter you created before. If you haven't defined any parameter, click + New Parameter to create a new input parameter.

    The parameter is automatically added to the Value input box and the step.

  5. To convert back to the original constant value, click the icon again and move the Use Input Parameter switch to off state.

To save the step result in an output parameter:

In the step editing pane, you can save the result of a conditional step or a verification step in an output parameter. For details, see Add conditional steps and Add verification steps.

Back to top

See also: