近年來由於網際網路的蓬勃發展,人們對於網路的依賴性逐漸提升,因此出現提供各式各樣服務的網站。網站的服務程式必須測試才能保證功能正常運作,為了減少測試的負擔,自動化測試工具取代了人工測試。自動化測試工具可以提供基本的錄製與播放腳本功能以及程式語法來滿足測試需求,但測試人員並非精通每一種工具的程式語法,且網站每更新一次版本都需要對腳本做修正,並在不同的瀏覽器上執行測試,這會增加測試人員的負擔。為了讓測試人員無須程式背景且不限定單一測試工具,也能做跨瀏覽器的測試,我們設計一個自動化產生測試腳本系統,包含了兩個功能:(1)以 XML 的中介格式,並轉換成 Selenium WebDriver、(2)自動化系統有兩種輸入方式:Activity Diagram 或 Selenium IDE Script,將之轉換成 XML 中介格式。XML 中介格式可轉成 Selenium WebDriver API 測試碼,並可開啟不同的瀏覽器,並做 Web UI 測試。
As people rely more on the Internet, various web-based applications have been developed. A web-based application must be tested in order to ensure that it can work properly. To reduce efforts for testing, automated testing tools have been used. Most automated testing tools provide record/playback functions as well as a test script language. But a tester may not be familiar with all the script languages of different testing tools. When a web application is modified, the test scripts have to be updated and re-executed on different browsers. In this thesis, we present an approach to automated testing script generation. Our approach consists of two parts: (1) an XML-based script representation and its translation to Selenium WebDriver, and (2) transformation of two input formats, UML Activity Diagram and Selenium IDE script, to the XML-based script representation. The XML-based script representation can be converted into Selenium WebDriver API, which can then be executed on browsers for Web UI testing.