Replace literals with datapool references
If you have an existing test script, you can replace literal values in the script with datapool references to add realistic data to the script. You can find and replace all literals, or just the number, string, or boolean literals with a datapool reference.
You can also add a literal from a script to a datapool. If you do not use an existing datapool variable, the same literal values (the values that were captured when you recorded the test script) are used each time you run the script.
To replace a literal with a datapool reference:
- Click Script > Find Literals and Replace with Datapool Reference.
- Under Direction, click Forward or Backward to set the direction you want to search through a test script.
- Under Literal Type, set the type of literal you want to find from the following list:
- All -- Click to find all literals in a script.
- Numbers -- Click to find number literals in a script. A number includes integers (a whole number, not a fractional number, that can be positive, negative, or zero) or floating numbers (positive and negative decimal numbers).
- Strings -- Click to find string literals in a script. A string stores alphanumeric values such as name, city, or state.
- Booleans -- Click to find boolean literals in a script. Any use of the boolean literals true or false are flagged for substitution.
- Click Find to start the search.
The name of the literal found in the test script appears under Literal.
- Click the Datapool Variable arrow to display the datapool variables and then click the datapool variable that you want the script to reference.
- Optionally, type a new variable name for the datapool variable you selected.
- Optionally, click the Add Literal to Datapool check box to add the literal value to the datapool.
- Click Replace to replace the literal in the script with a datapool variable reference.
The cursor automatically moves to the next literal in the test script.
If you have a literal that is a choice in a combo box in the application-under-test, when you replace the literal with a datapool reference, you get a string data type instead of an a enumerator data type in the datapool.
- When you find the next literal in the test script, repeat steps 5 through 7.
- When finished, click Close.
Functional Tester updates the datapool with any new columns and initial values that you add in this dialog box.
Associating a datapool with a group in a simplified script
Properties view - General page