在網際網路的普及下,各種開發網站的架構越來越來多。為了提升網站的可靠性,出現了各種網頁測試工具。其中錄製並播放測試腳本是一種快速、直接的方法,但是錄製卻無法解決過程中需要條件判斷敘述的情形,而且使用者在頁面上的操作有多種可能性,造成錄製的困難與負擔。在本論文中,我們提出測試人員可藉由UML Activity Diagram編輯器繪出測試流程,其流程中的Activity Node可填入導頁、對元素操作、檢查當前頁面(Condition)等資訊,並存成XML格式檔。由我們設計的測試系統,利用Java API的XMLDecoder讀取Activity Diagram資料,並一個Node接一個Node地產生對應測試動作的程式碼,測試碼借助Selenium WebDriver API,對被測網頁進行操作,達成與使用者相同動作的測試。
As Internet applications are getting more popular, many web application frameworks are developed. Various web testing tools are also developed to enhance the reliability of web applications. One rapid and direct method to test web pages is to record test script and then playback. However, recording can not properly handle the huge possibilities of user operations on web pages. In this thesis, we proposed to use a UML Activity Diagram to model the testing process of a web-based application. Activity Node can contain information for web page redirection, operation on web elements, current page condition check and others. The information of the diagram are saved in XML format. Our test system will read the XML file of an Activity Diagram using Java XMLDecoder API to generate the corresponding code for each node. The generated test code will then invoke Selenium WebDriver API to test the web pages.