Configuring Datapools, Synchronization Points, and Shared Variables |
When you record a session, you indicate whether a script generated from the session uses datapools. A generated script that uses a datapool includes a block of code opening the datapool such as the following:
tssPool.Open LoadResString(testscript1), _ rtCOM.GetDatapoolAccessFlags, _ rtCOM.GetDatapoolOverrideList
The datapool name testscript1
is the same as the script name. Create and populate the actual datapool you want your test script to use, and replace testscript1
with the datapool\xd5 s name. Now, when your script plays back, it retrieves configuration information from the project resource (.res) file regarding this datapool. So you need to edit the .res file as explained below.
Go to the project directory and double-click the project resource (.res) file.
Note: If the file does not open when you double-click the .res file, this indicates that the Visual Basic resource editor was not installed on the local machine. In this case, install the resource editor and configure it to start up with Visual Basic.
When the resource file opens, you see a display such as:
Click the + by the String Table folder to open it and double-click the String Table file inside. When the String Table opens, a display such as the following appears:
By default, on playback, the script does not use the datapool. This is because every field is set to EXCLUDE
. So, for every field that should be populated from a datapool column of the same name, change EXCLUDE
to INCLUDE
by doing the following.
Inspect the string between EXCLUDE
and the comma. It is a concatenation of these names: class, interface, method, and parameter. This string indicates an input field whose value may be supplied from a corresponding datapool column.
EXCLUDE
and change it to INCLUDE
.
You can also change EXCLUDE
to OVERRIDE
. If you do this, the value in quotes at the end of the line is inserted into the field on playback, rather than values from the corresponding datapool column.
Now, when you run the script, the datapool is used as indicated. To supply a different datapool configuration, re-edit the resource file and run the script again.
Finally, you may add access flags for the datapool: see TSSDatapool.Open for a description of access flags. If you add access flags to the resource file, and do not specify any with the Open call, the access flags named in the resource file are used for the datapool. Add access flags to the DATAPOOL_CONFIG line (62000), following the instructions above. For example, to specify the default datapool access flags, modify line 62000 as follows:
DATAPOOL_CONFIG DP DP_WRAP DP_SEQUENTIAL DP_SHARED
Note that, in the resource file, datapool access flags are specified without the TSS_
prefix. They are otherwise identical to the access flags described for the Open method.
Rational Test Script Services for Visual Basic | Rational Software Corporation |
Copyright (c) 2003, Rational Software Corporation | http://www.rational.com support@rational.com info@rational.com |