2015年11月4日 星期三

強大 軟體 自動 測試 工具 SAFS framework open source 多平台 多語言 關鍵字驅動 獨立工具

http://safsdev.sourceforge.net/Default.htm

SAFS
Software Automation Framework Support

Updated 2015.08.25
Initially developed by Carl Nagle for SAS Institute
Evolves as Opensource with permission from SAS Institute

Visit our Software Automation Framwork Support SAFSDEV Project on GitHub.
Visit our Software Automation Framwork Support SAFSDEV Project on SourceForge.


http://www.ibm.com/developerworks/rational/library/09/plainlanguagetestscriptusingsasfwithrft/
Use plain language for test scripts by implementing SAFS with Rational Functional Tester
使用簡單語言來測試軟體,實作SAFS用於IBM® Rational® Functional Tester 功能測試

SAFS framework 特色是
是open source 
多平台
多語言
關鍵字驅動
獨立工具

現在假設你需要測試 一個 ClassicsJavaA
可想而知是個 Java ,你需要JVM (JRE)環境,這裡用1.5.10版

他另外也裝了 MS  Windows Script Host 5.6

安裝SAFS
Install SAFS
To install SAFS:

Go to the SourceForge Web site, and type SAFS in the Search window.
你可以去SourceForge下載相關工具
Click the SAFS page link, and select View all files.
進入頁面 到 選擇 看 全部檔案

Expand SAFSRelease2007.04.18, 
and download the SAFSRelease2007.04.18.ZIP file.
Extract the contents of the~~~~~ SAFSRelease2007.04.18.zip file.
下載 並解壓縮 SAFSRelease2007.04.18.zip 

Double-click the SetupSAFS.wsf script file. SAFS and STAF are installed in these default locations:
執行SetupSAFS.wsf (是 MS  Windows Script Host 批次檔 描述)
會裝到下列路徑
c:\safs
c:\staf
如果想更新 你可以看看" SAFSOverlay \ SAFSOverlay_README.txt "
或是如上述法覆蓋


The SAFS directory structure Give the test project this directory structure:
SAFS 檔案結構如下 

Project_path\Datapool
Project_path\Datapool\Bench
Project_path\Datapool\Dif
Project_path\Datapool\Logs
Project_path\Datapool\Test

舉例你的專案叫   MyTests, SAFS目錄該這樣
For example, if Project_path is c:\MyTest, then the SAFS directory structure is as follows:
C:\MyTests\Datapool
C:\MyTests\Datapool\Bench
C:\MyTests\Datapool\Dif
C:\MyTests\Datapool\Logs
C:\MyTests\Datapool\Test
For additional information and custom installation details, see the SetupSAFS.Readme file that is listed in the Resources section.新增訊息與自訂請看 SetupSAFS.Readme 


Configuring Rational Functional Tester
設置專案去

1. Enable the Java environment in Rational Functional Tester.

2. Run the C:\SAFS\SetupRationalClasspath.WSF script to locate and add IBM Rational JAR files to the CLASSPATH.
在JVM裡要執行當然要在config 寫入java的路徑資訊CLASSPATH
請 執行 C:\SAFS\SetupRationalClasspath.WSF

Important:
Do not name any Rational Functional Tester scripts, "TestScript," because SAFS uses this name. Also make sure that there are no files named:
注意檔名不要與環境檔案衝突

TestScript.java
TestScript.class
TestScriptHelper.class

接著 細節 c:\safs\safstid.ini
[SAFS_LOGS]
AUTOLAUNCH=TRUE
是否預設執行
OVERWRITE=TRUE
是否覆蓋紀錄
CAPXML=TRUE
XML支援

c:\safs\Project\tidtest.ini 
[SAFS_PROJECT]
ProjectRoot="C:\safs\project"
專案名
[SAFS_TEST]
TestName="TIDTest"
測試民
TestLevel="Cycle"
CycleSeparator=","
CycleLogName="TIDTest.SAFS"
紀錄檔名
CycleLogMode="TEXTLOG XMLLOG"
millisBetweenRecords= 0

執行設置 ,執行 runTIDTest.bat , 
java –Dsafs.project.config="c:\safs\project\TIDTEST.ini" org.safs.tools.drivers.SAFSDRIVER pause


Tip: 請確認你的路徑,請停止SAFS 的所有服務與執行工作

If there is an error when the batch file runs, the command prompt displays the error message until you press a key. Without the pause command, the error message is not displayed with sufficient reading time.

Run the runTIDTest.bat file located in C:\safs\Project. 執行批次檔的地方

After the runTIDTest.bat file runs a log named TIDTest.SAFS.txt is generated in C:\safs\Project\Datapool\Logs. The log file contains this message: 
OK TIDTest Services all present and working.



C:\SAFS\Project \ RFTTest.ini 
Edit runRFTTest.bat file, which is the C:\SAFS\Project folder, adding a pause command: 
java –Dsafs.project.config="C:\safs\project\RFTTest.ini" org.safs.tools.drivers.SAFDRIVER pause


確認有 C:\safs\Project\Datapool\Logs \ RFTTest.txt
讀讀 SetupRFT.Readme  

呼 終於完成 configure

 接下來 看看 有哪些 元件

 執行
runTIDTest.bat 
runRFTTest.bat
會有
在 C:\MyTests\Datapool
Cycle table (.CDD file) 循環,記錄完成的大事件
Suite table (.STD file) 確認,Step的大事記
Step table (.SDD file) 步驟,記錄低階 io 與檔案處理
Map file 是RTTI或記憶體內容
四個檔案 
(不過你不用一一自己看,下面有工具)


java 處理緒內容 資訊
The STAF Process Container window
To get the details for the map:

Start the STAF server 在開始功能表,程式集 STAF- Software Testing Automation Framework.
啟動STAF server 
Click Start STAF, and then minimize the command prompt that opens.
會有常駐圖示

執行批次檔   C:\safs\Project \ STAFProcessContainer.bat
  
開啟執行 STAF Process Container window 


本文 省略一些 註解 請看原文



Test Automation Frameworks




REFERENCES:
How Do I...?









沒有留言: