使用 TestManager 資料儲存區和 Functional Tester

如果已安裝 TestManager,您可以透過 Rational® Test Script Services (TSS) 支援,搭配 Functional Tester 來使用 TestManager 資料儲存區。

關於如何透過 TSS 來使用資料儲存區的相關資訊,請參閱 API 文件。

若要顯示 TSS 文件:

若要在 Functional Tester 中使用 TestManager 資料儲存區, 請將下列 import 陳述式新增至 Functional Tester Script:

 		import com.rational.test.tss.*; 

若要在 Functional Tester 中使用 TestManager 資料儲存區,資料儲存區名稱必須包含完成路徑,使用雙反斜線來指定資料儲存區的位置。如果使用 UNIX®,則檔案分隔字元是一條斜線。

註: 這個 Functional Tester 版本有新的資料儲存區特性。建議您使用 Functional Tester 新增的資料儲存區特性。您可以將 TestManager 資料儲存區匯入新的 Functional Tester 資料儲存區中,就可以使用 Functional Tester 新增的資料儲存區特性。如果需要詳細資訊,請參閱建立資料儲存區

關於 TestManager 整合附註:Functional Tester 和 Rational TestManager 7.0 版已整合。如果您有 TestManager 7.0 版,您可以使用 Functional Tester 和 TestManager 的整合特性。請參閱了解 Functional Tester 整合,以取得產品一起使用的重要資訊。

注意:
如果從 TestManager 中以資料儲存區來執行 Script,則只需要使用資料儲存區的檔名。請勿使用資料儲存區的完整路徑名稱,因為這樣將無法從 TestManager 執行 Script。

範例:

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{ 

//建立資料儲存區物件
TSSDatapool dp = new TSSDatapool(); 
//開啟資料儲存區 testdpool

		dp.open("testdpool");
				//從資料儲存區提取第一列資料
				test = dp.fetch(); 
				//在資料儲存區中循環 5 次 for(int i = 0; i<5; i++)
				{ 
				//從 custname 直欄取得字串值
				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");
				} 


				} 
				} 
				} 

意見
(C) Copyright IBM Corporation 2000, 2007. All Rights Reserved.