background image
<< Planning and Creating a Datapool | Generate Data >>
<< Planning and Creating a Datapool | Generate Data >>

Create and populate the datapool

Working with Datapools
10-6
2. Generate datapool code.
To access a datapool at runtime, a script must contain datapool commands, such
as commands for opening the datapool and fetching a row of data. With session
scripts, a
DATAPOOL_CONFIG
section must also be present. This section
contains a variety of information about how the datapool is created and accessed.
Datapool code is generated in either of these ways:
­
With session scripts, Robot generates datapool code automatically when you
finish recording a script. Robot is aware of all the variables in the script that
are assigned values during recording, and it matches up each of these
variables with a datapool column.
To have Robot generate datapool commands automatically during
recording, make sure Use datapools is selected in the Generator tab of the
Session Record Options dialog box, and then record the script.
­
With GUI scripts, you manually insert the datapool commands and match up
script variables with datapool columns. For information about coding
datapool commands, see Using Datapools with GUI Scripts on page 10-24.
3. Create and populate the datapool.
After the datapool commands are in the script, you can create and populate the
datapool.
To start creating and populating a datapool for a session script you are editing in
Robot, click Edit, and then
Datapool Information.
If you are creating a datapool for exclusive use by a GUI script, use TestManager
to create and populate the datapool. For more information, see Rational
TestManager User's Guide
.
Creating and populating a datapool for a session script involves these
general steps:
­
Editing the
DATAPOOL_CONFIG
section of the script. For example, you
might want to change the default datapool access flags or exclude a datapool
column from being created for a particular script variable. Optionally, you
can accept all the default settings that Robot specifies when it creates this
section in a session script.
For information about editing the
DATAPOOL_CONFIG
section of a script,
see Step 1. Editing Datapool Configuration on page 10-14.
­
Defining the datapool columns that you determined you needed during the
planning stage. For example, for an Order Number column, you can specify
the maximum number of characters that an order number can have and
whether the Order Number column must contain unique values.