Software QA FYI - SQAFYI

Rational Robot FAQ

Part:   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27   28  29  30  31  32  33  34  35  36 

Datapool Commands
In order to use the datapool functionality you must add the sqautil.sbh header file to all your scripts that will utilize the datapool.
SQADatapoolFetch - is used to retrieve an entire row (record) of values from the datapool. Call SQADatapoolFetch(dp)
SQADatapoolValue - is used to retrieve an individual value from the fetched datapool row and assign it to a script value.
Call SQADatapoolValue(dp, 4, ccNum)
dp = datapool name
4 = the column in datapool
ccNum = the column name in the datapool
SQADatapoolOpen - is used to open a specific datapool.
dp=SQADatapoolOpen("name of datapool")
SQADatapoolClose - is used to close a specific datapool.
Call SQADatapoolClose(dp)

Example of a GUI Script that used datapools:
‘$Include "sqautil.sbh"

Sub Main
	Dim Results as Integer
	Dim x as Integer	
	‘reference the datapool
	Dim dp as Long	
	‘variable to be assigned data from the datapool
Dim ccNum as String
	
	‘Open the datapool
	dp=SQADatapoolOpen("name of datapool")

	‘now this code will populate a full record from the datapool 10 times.
	For x = 0 to 9
	Call SQADatapoolFetch(dp)
	‘Begin
	Window SetContext, "Caption=Main Window; Class=Window", ""
	PushButton Click, "Text=Order"
	Window SetContext, "Caption=Order Window; Class=Window’, ""

	‘add the value to the order window
	Window SetContext, "Caption=Order Window; Class=Window’, ""
	EditBox Click, "ObjectIndex=3", "Coords=13,14"
	Call SQADatapoolValue(dp, 4, ccNum)
	InputKeys ccNum

	Window SetContext, "Caption=Order Window; Class=Window’, ""
	PushButton Click, "Text=OK"

Next x
	Call SQADatapoolClose(dp)
End Sub

How to edit datapool configuration and to begin the process of defining and generating a datapool:
1. If the script that will access the datapool is not open for editing, click File > Open > Test Script to open it.
2. Click Edit > Datapool Information to open the Configure Datapool in Test Script dialog box.
This dialog box lets you edit the DATAPOOL_CONFIG section of the script.
3. Either accept the defaults in the Configure Datapool in Test Script dialog box, or make any appropriate changes.
4. When finished making any changes, click Save.
5. Take one of these actions:
.Click Create to define and populate the new datapool.
.Click Close if you do not want to define and populate a datapool at this time.
6. If you clicked Create in the previous step, continue by following the instructions in the section

How to Define and populate the datapool?

  1. To insert one or more new columns into the datapool file:
    a. Click the row located either just before or just after the location where you want to insert the new datapool column. (Note that the order in which datapool column names are listed in Name determines the order in which values are stored in a datapool record.)
    An arrow appears next to the name of the datapool row you clicked.
    b. Click either Insert before or Insert after, depending on where you want to insert the datapool column.
    c. Type a name for the new datapool column (40 characters maximum).
    Make sure there is a script variable of the same name listed in the Configure Datapool in Test Script dialog box. The case of the names must match.
  2. For each datapool column in the grid, assign a data type to the column, and modify the default property values for the column as appropriate.
  3. When finished defining datapool columns, type a number in the No. of records to generate field.
    If a different row has to be retrieved with each fetch, make sure the datapool has at least as many rows as the number of users (and user iterations) that will be requesting rows at runtime.
  4. Click Generate Data.
    You cannot generate data for a datapool that has more than 150 columns. Alternatively, if you do not want to generate any data now, click Save to save your datapool column definitions, and then click Close.
  5. Optionally, click Yes to see a brief summary of the generated data.

Part:   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27   28  29  30  31  32  33  34  35  36 

Rational Robot FAQ