在 Web UI 流程測試中,常常需要由人工手動測試,或者錄製腳本再交由工具執行測試,往往需要耗費大量的人力與時間成本。因此我們希望能在一開始規劃建模開發系統時,以程式設計師根據系統流程設計的 WorkFlow 為依據,自動化產生流程測試腳本,藉此在功能測試時降低額外撰寫測試腳本的時間成本。 在本論文中,基於以 BPMN Diagram 描述建模開發的應用系統,我們提出了可自動化產生流程測試腳本的系統。透由 DOM4j API 分析 BPMN 內容中頁面間執行的順序及分支狀態的運算,以 Depth First Search 演算法整理出所有可能的流程路徑並根據路徑清單產生了測試腳本,透過編輯器加入欲測試的參數值,最後整合 Sahi 自動化 Web UI 自動化測試工具,執行產生的測試腳本。透過執行時瀏覽器模擬的動作及執行完所產生的測試報告,查看流程測試結果是否達到輸入測試值預期執行結果的目標,進而檢測系統流程功能的正確性。
To test a Web-based workflow system, one needs to perform the test manually or to record the test script and the play it back using a testing tool. Both methods require a lot of manual efforts. It is hoped that when a system designer designs a workflow, the associated test script could also be generated to reduce the cost and efforts of functional testing. In this thesis, we will present a system that could generate test scripts if the workflow of an application system is modeled based on BPMN Diagram. The order of pages execution and branch status contained in BPMN file were analysed using Dom4j API. Depth first search algorithm was used to sort possible flow paths and to generate a list of test scripts. An editor was used to add parameters in test scripts. Sahi automated web UI testing tool was used to execute the test script in the browser. The generated test report was used to check whether the test results are the same as expected, to verify the correctness of system functionalities.