PTF Test Language
This section discusses the components of the PTF test language.
Each step type allows only certain actions. Similarly, each action can only be used with certain step types.
The PTF Test Editor automatically limits your choice of actions based on the step type selected.
For example, if a step has the Type field set to Text and the Action field set to Set_Value, you can change the Action field to Verify since it is included in the list of available values for a text object.
This example shows a drop-down list with Verify as one of the values for the Action field when the Type field is set to Text:
Typically, you place parameters in the Parameters field and use the following structure:
Separate parameters with a semi-colon.
With a Radio object, you can also place parameters in the Value field.
Steps that return a
value require the parameter
The system ignores unneeded parameters. For example, Browser.Start and Browser.Start_Login do not take any parameters, so the system ignores any values in the Recognition field for Browser.Start or Browser.Start_Login.
The PTF Test Editor provides context sensitive help for recognition and parameters. In the Recognition column or Parameters column you can either press the F4 key, or double-click and then click the More icon that appears, to view the help and enter the corresponding values.
For examples see Context Sensitive Help within Grid for Function Parameter Details
Variables enable you to work with steps in which the information or values are not known when you create the test or the information or values for a step change each time the test executes.
You prefix variables with an ampersand (&).
In this example, the first step stores the value in the userid field to the variable &USERID. The second step populates the pwd field with the value in the variable &USERID.
Similar to variables, you use reserved words to supply information that is not known until a test executes.
Prefix reserved words with a pound sign (#) and use them in the Value field of a test to verify a condition, change the value in an application field, or both. In this example, the #TODAY reserved word sets the EFFDT_FROM field to the current date.
System variables are predefined variables that PTF populates at runtime. System variables provide data about the current environment, execution options, test, and application.
Because system variables are replaced with a text string at runtime, you can place a system variable wherever you would place a text string. Commonly, test developers assign a system value to a user-defined variable.
The following example shows two methods of assigning system variables to user-defined variables:
If the syntax or value in a test step is not correct, the test will produce an error when the test is executed. The Check Syntax option allows a user to validate the parameters provided in their steps either on save or on demand prior to execution.
Check Syntax will:
Display an error message for any invalid or missing required parameter values.
Display a error message for any invalid optional parameter values.
Display a warning message when the return value of a step has not been entered.
Display an error window listing all errors and warnings found in sequential order for a test.
Note: There may be multiple errors in a single step.
Display an error when syntax is incorrect or missing, such as verifying that all Conditional.If steps are paired with Conditional.End_if steps.
Note: Check syntax validates only active steps. Only syntax is validated, not data.
Check Syntax does not validate:
File and folder names.
Parameter that is not available for the action.
Missing parameter name.
Running On Demand Syntax Check
After you have edited your test, select Test, Check Syntax or click the Check Syntax icon. The errors and warnings will be displayed. When you click on the error or warning in the Test Check Syntax window, the step is highlighted in the test.
If the syntax check does not detect any errors or warning, the dialog box will not return any rows of data:
Automatically Running Syntax Check on Save
To have Syntax Check run automatically every time you save a test:
In PTF Explorer, click on your environment name and select Local Options.
In the Auto-Check Syntax field select Yes and click OK.
When you save a test, you will be prompted to run the syntax check.
For any step type/action that includes parameters, you can press the F4 key or double-click in the Parameters cell to display and enter the parameters. For each parameter, an explanation and example are displayed. This is an example of the step Process.Run:
For some step types, for example Query, you can also double-click in the Value column to display and enter parameters.