<ruby id="h6500"><table id="h6500"></table></ruby>
    1. <ruby id="h6500"><video id="h6500"></video></ruby>
          1. <progress id="h6500"><u id="h6500"><form id="h6500"></form></u></progress>
            • 軟件測試技術(shù)
            • 軟件測試博客
            • 軟件測試視頻
            • 開(kāi)源軟件測試技術(shù)
            • 軟件測試論壇
            • 軟件測試沙龍
            • 軟件測試資料下載
            • 軟件測試雜志
            • 軟件測試人才招聘
              暫時(shí)沒(méi)有公告

            字號: | 推薦給好友 上一篇 | 下一篇

            自動(dòng)化測試框架Tellurium使用方法介紹

            發(fā)布: 2011-2-28 09:40 | 作者: 方劍 | 來(lái)源: 領(lǐng)測軟件測試網(wǎng)采編 | 查看: 94次 | 進(jìn)入軟件測試論壇討論

            領(lǐng)測軟件測試網(wǎng)

              測試方法

              Tellurium采用一種新的方式,通過(guò)UI module的概念來(lái)進(jìn)行自動(dòng)化測試。使用對象封裝Web UI的元素,因此不再需要手動(dòng)生成和重構UI的定位器。UI module是個(gè)簡(jiǎn)單的復合UI對象,由嵌套的基本UI對象組成。

              這個(gè)框架可以在兩種模式下運行。第一種模式是作為Selenium框架的wrapper來(lái)工作。也就是說(shuō),Tellurium core基于UI module中的UI對象屬性,生成運行時(shí)定位器。生成的運行時(shí)定位器然后通過(guò)Tellurium擴展傳遞給Selenium core來(lái)調用。

              Tellurium還在開(kāi)發(fā)它自己的驅動(dòng)引擎,即Tellurium Engine,以更好更有效地支持UI module。

              首先,Tellurium Core把UI module轉換成JSON的表示形式。

              然后在使用UI module時(shí),JSON表示的數據被第一次傳遞給Tellurium Engine。

              接著(zhù)Tellurium Engine使用Santa算法,定位整個(gè)UI module,并將其存在緩存中。

              在接下來(lái)的調用中,會(huì )直接使用緩存的UI module,而不需要重新定位了。

              此外,Tellurium Core把多條命令合并成一條批處理命令,叫做宏命令,然后在一次調用中把這條批處理發(fā)送給Tellurium Engine。這樣可以減少請求/響應帶來(lái)的延遲。

              下面這個(gè)例子,使用了該項目網(wǎng)站上的問(wèn)題搜索UI,來(lái)表述框架背后的思想。

              我們從為問(wèn)題搜索的UI定義UI module開(kāi)始吧:

              ui.Form(uid: "issueSearch", clocator: [action: "list", method: "GET"]) {

              Selector(uid: "issueType", clocator: [name: "can", id: "can", direct:

              "true"])

              TextBox(uid: "searchLabel", clocator: [tag: "span", text: "for"])

              InputBox(uid: "searchBox", clocator: [type: "text", name: "q", id: "q"])

              SubmitButton(uid: "searchButton", clocator: [value: "Search", direct:

              "true"])

              }

              然后使用下面這個(gè)測試方法:

              public void searchIssue(String type, String issue){

              select "issueSearch.issueType", type

              keyType "issueSearch.searchBox", issue

              click "issueSearch.searchButton"

              waitForPageToLoad 30000

              }

              如果有一天,你需要把Selector修改成輸入框,那我們只需要更新對應的UI module:

              ui.Form(uid: "issueSearch", clocator: [action: "list", method: "GET"]) {

              InputBox(uid: "issueType", clocator: [name: "can", direct: "true"])

              TextBox(uid: "searchLabel", clocator: [tag: "span", text: "for"])

              InputBox(uid: "searchBox", clocator: [type: "text", name: "q", id: "q"])

              SubmitButton(uid: "searchButton", clocator: [value: "Search", direct: "true"])

              }

              然后修改命令:

              select "issueSearch.issueType", type

              為:

              type "issueSearch.issueType", type

              其余則保持不變。

              如果有動(dòng)態(tài)的Web內容,比如Google Books的網(wǎng)站,它包含了一個(gè)圖書(shū)分類(lèi)的列表,每個(gè)分類(lèi)中包含一個(gè)圖書(shū)列表。針對這樣UI的UI module會(huì )出奇的簡(jiǎn)單:

              ui.Container(uid: "GoogleBooksList", clocator: [tag: "table", id: "hp_table"]) {

              List(uid: "subcategory", clocator: [tag: "td", class: "sidebar"], separator:

              "div") {

              Container(uid: "{all}") {

              TextBox(uid: "title", clocator: [tag: "div", class: "sub_cat_title"])

              List(uid: "links", separator: "p") {

              UrlLink(uid: "{all}", clocator: [:])

              }

              }

              }}

              Tellurium UID描述語(yǔ)言為定義動(dòng)態(tài)Web內容提供了更多的靈活性。我們來(lái)看個(gè)復雜點(diǎn)的例子。

            延伸閱讀

            文章來(lái)源于領(lǐng)測軟件測試網(wǎng) http://kjueaiud.com/

            32/3<123>

            關(guān)于領(lǐng)測軟件測試網(wǎng) | 領(lǐng)測軟件測試網(wǎng)合作伙伴 | 廣告服務(wù) | 投稿指南 | 聯(lián)系我們 | 網(wǎng)站地圖 | 友情鏈接
            版權所有(C) 2003-2010 TestAge(領(lǐng)測軟件測試網(wǎng))|領(lǐng)測國際科技(北京)有限公司|軟件測試工程師培訓網(wǎng) All Rights Reserved
            北京市海淀區中關(guān)村南大街9號北京理工科技大廈1402室 京ICP備10010545號-5
            技術(shù)支持和業(yè)務(wù)聯(lián)系:info@testage.com.cn 電話(huà):010-51297073

            軟件測試 | 領(lǐng)測國際ISTQBISTQB官網(wǎng)TMMiTMMi認證國際軟件測試工程師認證領(lǐng)測軟件測試網(wǎng)

            老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月
              <ruby id="h6500"><table id="h6500"></table></ruby>
              1. <ruby id="h6500"><video id="h6500"></video></ruby>
                    1. <progress id="h6500"><u id="h6500"><form id="h6500"></form></u></progress>