和 Functional Tester 一起使用 TestManager 数据池

如果您已经安装了 TestManager,那么通过 Rational® 测试脚本服务 (TSS) 支持,您可以和 Functional Tester 一起使用 TestManager 数据池。

有关如何通过 TSS 使用数据池的信息,请参阅 API 文档。

要显示 TSS 文档:

要和 Functional Tester 一起使用 TestManager,请将以下导入语句添加到 Functional Tester 脚本:

 		import com.rational.test.tss.*; 

要和 Functional Tester 一起使用 TestManager,数据池名称必须包含完整路径(数据池处要使用双反斜线)。 如果您使用 UNIX®,那么文件分隔符是正斜线。

注: 此版本的 Functional Tester 包含新数据池功能。推荐使用 Functional Tester 的新数据池功能。您可以将 TestManager 数据池导入到新的 Functional Tester 数据池,以使用 Functional Tester 的新数据池功能。有关更多信息,请参阅创建数据池

关于 TestManager 集成的说明:Functional Tester 已与 Rational TestManager V7.0.2 集成。如果您具有 7.0.2 版本的 TestManager,那么将能够使用 Functional Tester 和 TestManager 的集成功能。

警告:
如果您使用 TestManager 中的数据池来运行脚本,那么请只使用数据池的文件名。 请勿使用数据池的完整路径名,因为如果使用数据池的完整路径名,那么就无法运行 TestManager 中的脚本。

示例:

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");
				} 


				} 
				} 
				} 

反馈