Back To Normal

Subscribe To Our E-Mail Newsletter

Wednesday, February 9, 2011

DataPool in RFT


Couch ModePrint It

Data Pool:

Definition : Data Pool is like excel where user can keep data , sql queries and logs.

Create Data Pool :

User Can create two types of data Pool in IBM RFT.

1. Select "Test Data pool" from the File --->> New .

2. Select the Working folder to place data pool location.

3. Enter the Data Pool name of the file.

4. click the Next button.

5. If u want to create empty data pool then click finish button . otherwise if you want to import data from other sources like CSV .. then click the browse button to specify the location of that file.

6. Specify the delimiter or separator like comma or space or tab..

7. Click the finish button.

It will create the data pool under the selected working folder.

Private Data Pool:

When user planning to keep private data pool for that test script. He can add the private data pool in the "Script Explorer".

Right Click the Test Data Pool and Add "Associate Data pool".

Export the Data Pool:

User can export the data pool data as CSV file. Select the Export from file menu or right click the data pool and select the "export " option.

Specify the File name and select the File Separator . Click the Finish Button to export the data.



Read the Data pool Data:

public ArrayList ReadDP(String DpName, String ColumnName) {

ArrayList DpContent = new ArrayList();
java.io.File dpFile = new java.io.File(

(String) getOption(IOptionName.DATASTORE), DpName);

IDatapool dp = (IDatapool) dpFactory().load(dpFile, true);
//Use default iterator class

IDatapoolIterator dpIter = dpFactory().open(dp, null);
//Use default equivalence class

dpIter.dpInitialize(dp);

dpIter.dpReset();

while (!dpIter.dpDone()) {

// Insert actions using dpIter based references to the datapool

//Get the current datapool record

dpIter.dpCurrent();
//Get the String value at column index 0 in current record

String str = dpIter.dpString(ColumnName);
DpContent.add(str);
//Move the pointer to next record
dpIter.dpNext();
}
dpFactory().close(dpIter);
return DpContent;
}


Click Here For Smileys :D
:D
:)
:[
;)
:D
:O
(6)
(A)
:'(
:|
:o)
8)
(K)
(M)

No comments:

560 Free Online Courses

Top 200 universities launched 500 free online courses.  Please find the list here .