Using TestManager Datapools with Functional Tester

You can use TestManager datapools with Functional Tester through Rational Test Script Services (TSS) support. The TSS API documentation explains how to use datapools. The TSS documentation can be accessed from the Start menu if you have Rational Suites TestStudio, Enterprise Studio, or TeamTest version 2003.06.00: Start > Rational Product > Rational Test API > TSS for Java.

For TestManager datapools to work with Functional Tester, you need to add the following import statement to any Functional Tester script where datapools will be used:

import com.rational.test.tss.*;

For TestManager datapools to work with Functional Tester, the datapool name must contain the complete path using double backslashes where the datapool resides. If you are using datapools through TestManager, you can use the shorter base name only, and do not need the entire path.

Note that on UNIX, the file separator is a forward slash.

Note: This version of Functional Test has new datapools features. We recommend using the new TestManager datapools features; however, you can still use the old datapools features. You can import your TestManager datapools into a new Functional Tester datapool to use the new datapool features. For more information, see Creating a Datapool.

Notes About TestManager Integration

Functional Tester is integrated with Rational TestManager version 2003.06.13. If you have the 2003.06.13 version of TestManager, you will be able to use the integrated features of Functional Tester and TestManager. Please see Understanding Functional Test Product Packaging and Integrations for important information on using the products together.

Caution: Do not use the full path to the datapool in the script because if you use the full path to the datapool in the script, you cannot run the script from TestManager.

Example:

import resources.testOutHelper;
import com.rational.test.ft.*;
import com.rational.test.ft.object.interfaces.*;
import com.rational.test.ft.script.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;
import com.rational.test.tss.*;

public class testOut extends testOutHelper
{
public void testMain (Object[] args)
{
boolean test;
String strval2;
try{
//create datapool object
TSSDatapool dp = new TSSDatapool();
//open datapool named testdpool

dp.open("testdpool");

//Fetch first row of data from datapool
test = dp.fetch();
//Loop 5 times through datapool
for(int i = 0; i<5; i++)
{
//Get string value from custname column
DatapoolValue dpv = dp.value("custname");
strval2 = dpv.toString();
System.out.println("Name is " + strval2);
test = dp.fetch();
}

}
catch (Exception e) {
System.out.println("Exception occurred");
}


}
}
}

Terms of use | Feedback
(C) Copyright IBM Corporation 2002, 2004. All Rights Reserved.