If you have an existing test script, you can replace literal values
in the script with dataset references to add realistic data to the script.
You can find and replace all literals, or selectively replace the number,
string, or boolean literals with a dataset reference.
About this task
You
can also add a literal from a script to a dataset. If you do not use an existing
dataset variable, the same literal values (the values that were captured
when you recorded the test script) are used each time that you run the script.
To
replace a literal with a dataset reference:
Procedure
- Click .
- Under Literal Type, select or clear the
appropriate check boxes:
- 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.
- Search up -- Click to move back up through the
test script. Clear to move forward through the test script.
- Click Find Next to start the search.
The name of the literal found in the test script appears under Literal.
- Click the dataset Variable arrow to display
the dataset variables and then click the dataset variable that you want
the script to reference.
- Optionally, type a new variable name for the dataset variable
you selected.
- Optionally, click the Add literal to dataset check
box to add the literal value to the dataset.
- Click Replace to replace the literal in
the script with a dataset variable reference.
The cursor
automatically moves to the next literal in the test script.
Note: 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 dataset reference, you get a string data
type instead of an a enumerator data type in the dataset.
- When you find the next literal in the test script, repeat steps
4 through 6.
- When finished, click Close.
HCL OneTest™ UI updates the dataset with any new columns and initial values that you
add in this dialog box.