ui.StandardTable(uid: "GT", clocator: [id: "xyz"], ht: "tbody"){
TextBox(uid: "{header: first} as One", clocator: [tag: "th", text: "one"], self:
true)
TextBox(uid: "{header: 2} as Two", clocator: [tag: "th", text: "two"], self: true)
TextBox(uid: "{header: last} as Three", clocator: [tag: "th", text: "three"],
self: true)
TextBox(uid: "{row: 1, column -> One} as A", clocator: [tag: "div", class: "abc"])
Container(uid: "{row: 1, column -> Two} as B"){
InputBox(uid: "Input", clocator: [tag: "input", class: "123"])
Container(uid: "Some", clocator: [tag: "div", class: "someclass"]){
Span(uid: "Span", clocator: [tag: "span", class: "x"])
UrlLink(uid: "Link", clocator: [:])
}
}
TextBox(uid: "{row: 1, column -> Three} as Hello", clocator: [tag: "td"], self:
true)
}
在這個(gè)例子中,我們是使用元數據“first”、數字和“l(fā)ast”來(lái)指定header的位置。元數據“{row: 1, column -> One} as A”意味著(zhù)我們例子中的UI元素——一個(gè)TextBox,處于第一行,并和header“One”處在同一列。測試代碼很干凈,比如:
getText "GT.A"
keyType "GT.B.Input", input
click "GT.B.Some.Link"
waitForPageToLoad 30000
未來(lái)計劃
Tellurium是一個(gè)年輕而且創(chuàng )新的項目,它具有許多來(lái)自開(kāi)發(fā)團隊和用戶(hù)社區的新穎思想。Tellurium希望在以下領(lǐng)域繼續發(fā)展:
Tellurium 0.7.0已經(jīng)實(shí)現了一個(gè)新的使用jQuery的測試驅動(dòng)引擎。這個(gè)引擎的主要特性包括:UI module組定位、UI module緩存、命令集處理、用jQuery重新實(shí)現的Selenium API以及新的Tellurium API。Tellurium會(huì )繼續開(kāi)發(fā)這個(gè)新引擎直至完備。
Tellurium IDE module插件0.8.0 RC1剛剛發(fā)布,它包含了很多新的特性。錄制和生成測試腳本的Tellurium IDE的RC版本也已發(fā)布。它們是Tellurium成功的關(guān)鍵,因此會(huì )得到持續的改進(jìn)。除了Trump和Tellurium IDE,Tellurium還在計劃改善TelluriumWorks,讓它可以編輯、完成語(yǔ)法檢查,并運行Tellurium DSL測試腳本。
Tellurium作為云測試工具是另外一個(gè)非常重要的發(fā)展方向。項目團隊正在計劃重新考慮整個(gè)架構,使其可以更直接地并行執行測試。通過(guò)P2P技術(shù),只需最少的管理,就讓測試服務(wù)器在云的環(huán)境中具備自組織和自協(xié)調的能力,這是件極具挑戰性的工作。
Tellurium框架還希望發(fā)展的其他領(lǐng)域包括:
創(chuàng )建可重用的Dojo、ExtJS和jQuery UI Tellurium widget。這樣可以讓其他人只需要在自己的項目中包含對應的jar文件,就可以重用這些widget。
支持行為驅動(dòng)測試。
Web安全測試
支持其他的語(yǔ)言,比如Ruby
關(guān)于作者
方劍畢業(yè)于喬治亞理工學(xué)院,電子和計算機工程專(zhuān)業(yè)博士學(xué)位。他的工作是某IT公司的高級軟件工程師,致力于設計和實(shí)現企業(yè)級應用軟件。他是Tellurium自動(dòng)化測試框架項目的創(chuàng )建者。
文章來(lái)源于領(lǐng)測軟件測試網(wǎng) http://kjueaiud.com/