自動測試工具Tellurium快速上手指南
TelluriumQuickStart
Tellurium快速上手指南.
- 簡介
- Tellurium子項目
- 一點Tellurium概念
- Tellurium物件
- Locator
- UI模塊
- 測試案例">Tellurium測試案例
- Tellurium配置
- 運行Tellurium的條件
- 創建自己的Tellurium測試項目
- 創建自己的UI模塊
- 相關資源
簡介
Tellurium是一個開源的網頁測試框架,現階段還是建立在Selenium之上。 但有很多獨特的測試理念。 比之Selenium, 維護性,魯棒性, 和可復用性都要好。 它支持JUnit和TestNG。Tellurium的測試代碼可以用Java, Groovy和純DSL腳本來寫.
Tellurium子項目
Tellurium由以下子項目構成:
- Tellurium Core: 處理DSL, 自動生成Runtime Locator,和測試案例的支持。
- Tellurium Engine: 是Tellurium的底層測試驅動模塊
- Tellurium Widget: 是Tellurium的擴展,可以定義Javascript庫, 如Dojo和ExtJS,的Widget,以便重用。
- Tellurium UI Module Plugin (TrUMP): 是個Firefox插件,能夠讓用戶在待測網頁上選擇所需的UI元素,然后自動生成Tellurium UI模塊。
- Tellurium Reference Project: 是Tellurium的參考項目,測試代碼是為Tellurium項目的網頁而寫的。主要向用戶展示如何定義自己的Tellurium物件(Object), 如何寫Tellurium測試代碼,數據驅動代碼,和純DSL腳本。參考項目有兩個,分別為JUnit項目和TestNG項目。
- Tellurium Maven Archetypes: 方便用戶創建自己的Tellurium測試項目。有兩個Archetype,為JUnit項目和TestNG項目而設。
CQ">
一點Tellurium概念
雖然Tellurium脫胎于Selenium,但兩者在概念上有很大的不同。Selenium主要是用記錄和重播(Record and Replay)模式,而Tellurium要求你首先定義待測的UI模塊。下面列出Tellurium的一些主要概念:
Tellurium物件
Tellurium定義了一些常用的物件,如Button, Table, Form等。
Tellurium物件至少包含以下屬性:
- uid: 物件的引用名
- namespace: 用于XHTML,對HTML它總是null
- locator: 用于定位物件相對應的UI元素在網頁DOM中的位置。它會是XPath或由一系列的屬性構成,如HTML tag, type, value等等。 下節會更詳細介紹。
Tellurium物件 | Locator缺省屬性 | 額外屬性 | UI模板 |
Button | tag: "input" | ||
Container | group | ||
CheckBox | tag: "input", type: "checkbox" | ||
Div | tag: "div" | ||
Form | tag: "form" | group | |
Image | tag: "img" | ||
InputBox | tag: "input" | ||
RadioButton | tag: "input", type: "radio" | ||
Selector | tag: "select" | ||
Span | tag: "span" | ||
SubmitButton | tag: "input", type: "submit" | ||
UrlLink | tag: "a" | ||
List | separator | 可用 | |
Table | tag: "table" | group, header | 可用 |
StandardTable | tag: "table" | group, header, footer | 可用 |
Frame | group, id, name, title | ||
Window | group, id, name, title |
值得注意的是Tellurium物件大多為抽象物件,比如Container就可以實用于不同的HTML標簽。每個Tellurium物件都有一個uid,即它的別名。
延伸閱讀
文章來源于領測軟件測試網 http://www.kjueaiud.com/