background image
<< Standard and User-Defined Data Types | Generating Unique Values from User-Defined Data Types >>
<< Standard and User-Defined Data Types | Generating Unique Values from User-Defined Data Types >>

Finding Out Which Data Types You Need

306
Chapter 11 - Working with Datapools
To ensure that the variable is assigned a valid value from the datapool:
i
Before you create the datapool, create a data type named Colors that
contains the five supported values (
Red
,
Green
,
Blue
,
Yellow
,
Brown
).
ii
When you create the datapool, assign the Colors data type to the datapool
column COLOR. The COLOR column supplies values to the test script's
color
variable.
When you need to generate data that contains multi-byte characters, such as
those used in some foreign-language character sets. For more information, see
Generating Multi-Byte Characters on page 308.
Before you create a datapool, find out which standard data types you can use as
sources of data and which user-defined data types you need to create. Although you
can create a data type while you are creating the datapool itself, the process of creating
a datapool is smoother if you create the user-defined data types first.
Finding Out Which Data Types You Need
To decide whether to assign a standard data type or a user-defined data type to each
datapool column, determine the kinds of values to be supplied to test script variables
during playback--for example, whether the variable contains names, dates, order
numbers, and so on.
To find the kind of values that are supplied to a variable:
s
With VU test scripts, view the
DATAPOOL_CONFIG
section of the test script. (Robot
adds this information automatically during recording to a VU test script when you
select
Use datapools
in the
Generator
tab of the Session Record Options dialog
box.)
The
DATAPOOL_CONFIG
section contains a line for each value assigned to a test
script variable during recording. In the following example, the value
329781
is
assigned to the variable
CUSTID
:
INCLUDE, "CUSTID", "string", "329781"
For more information about the
DATAPOOL_CONFIG
section of a test script, see the
Rational Robot User's Guide
.
Creating User-Defined Data Types
If none of the standard data types can provide the correct kind of values to a test script
variable, create a user-defined data type.