• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

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

    教你初識Tellurium自動測試框架

    發布: 2009-5-30 11:25 | 作者: 網絡轉載 | 來源: 測試時代采編 | 查看: 73次 | 進入軟件測試論壇討論

    領測軟件測試網 Tellurium Automated Testing Framework(Tellurium自動測試框架)是一個新的開源項目。已經有一些用戶, 主要來自美國和印度, 國內的還是比較少。 希望這里把Tellurium介紹給國內的同行,請多多使用,多多交流。

      目前,Tellurium還是建立在Selenium框架之上, 在不久的將來希望Tellurium會開發自己的測試驅動Engine來更好,更有效地支持Tellurium.

      盡管Tellurium脫胎于Selenium, 但兩者在概念上是大大的不同。 打個比方,Selenium是C, 而Tellurium是C++。

      首先, Selenium主要用于記錄和重播模式(Record and replay), 這是很方便,但是在比較復雜的應用中這種模式并不能很好地工作, 因為你必須記錄可能的所以的測試情況, 除此之外, Data dependency(數據的依賴性)也是個大問題。

      第二, Selenium將測試的頁面表述(Locator)和測試代碼混在一起, 很難維護和重復使用(reuse)。

      第三, Selenium面對的是一個個單獨的網頁元素, 而且網頁元素的Locator很難作到魯棒性(robust)。

      那么Tellurium是如何克服上面的問題的呢?

      第一, Tellurium不是記錄和重播模式, 而是注重網頁模塊的。 首先你必須定義網頁模塊和對模塊的方法。 以Google頁面為例, Google搜索模塊可以定義為:

      ui.Container(uid: "Google", clocator: [tag: "td"], group: "true"){

      InputBox(uid: "SearchBox", clocator: [title: "Google Search"])

      SubmitButton(uid: "Search", clocator: [name: "btnG", value: "Google Search"])

      SubmitButton(uid: "Feelinglucky", clocator: [value: "I'm Feeling Lucky"])

      }

      然后, 你可以定義一些對它的操作方法,

      def doGoogleSearch(String input){

      type "Google.SearchBox", input

      pause 500

      click "Google.Search"

      waitForPageToLoad 30000

      }

      def doImFeelingLucky(String input){

      type "Google.SearchBox", input

      pause 500

      click "Google.FeelingLucky"

      waitForPageToLoad 30000

      }

      在此之上你可以像寫JUnit測試一樣的寫測試代碼, 例如:

      public class GoogleStartPageJavaTestCase extends TelluriumJavaTestCase {

      protected static NewGoogleStartPage ngsp;

      @BeforeClass

      public static void initUi() {

      ngsp = new NewGoogleStartPage();

      ngsp.defineUi();

      }

      @Test

      public void testGoogleSearch(){

      connectUrl("http://www.google.com");

      ngsp.doGoogleSearch("tellurium selenium Groovy Test");

      }

      @Test

      public void testGoogleSearchFeelingLucky(){

      connectUrl("http://www.google.com");

      ngsp.doImFeelingLucky("tellurium selenium DSL Testing");

      }

      }

      其次, 因為Tellurium是面向網頁模塊的, 而不是單獨的元素, 所以它可以應用團體信息來給元素定位(Group Locating)。 比如, 在上面例子中, 元素"Google"可以用它包含的InputBox和SubmitButton中的信息來給

      它自己定位。這樣使得這個網頁模塊只利用本身的信息, 而不依賴外部的信息。

      另一個Tellurium顯著的特點是它用Composite Locator,就是上面定義的clocator。 clocator很貼近網頁語言

      的定義, 而且它的Runtime(運行時)的locator是由Tellurium動態產生的, 比如,你改變了InputBox的title 屬性, 你不需要再修改其他的地方。 這一點和上面的Group Locating使得Tellurium具有很好的魯棒性, 可以自

      動適應網頁模塊外和模塊內的變化。

      Tellrium核心是用Groovy語言寫的, 這樣你可一用DSL來寫測試代碼。 Tellurium的特點包括:

      1)支持JUnit和TestNG

      2)測試代碼可以用Java, Groovy或DSL來寫

      3)支持Data Driven Testing (數據驅動測試)

      4)支持Ant和Maven

      Tellurium由下面的子項目構成:

      1)Tellurium Core: 核心

      2)Tellurium Reference Projects: 有TestNG和JUnit項目教用戶如何用Tellurium

      3)Tellurium UI Module Firefox Plugin (TrUMP), 它是一個Firefox的擴展,用戶可以用它來自動生成網頁模塊。

      4)Tellurium Widget Extension: 有Dojo和ExtJS的Widget模塊代碼, 這樣你只要在你的項目中加入一些jar文件,你就可以之間定義和測試這些Widget了。

      5)Tellurium Engine: 將來的測試驅動模塊。

    延伸閱讀

    文章來源于領測軟件測試網 http://www.kjueaiud.com/

    TAG: 初識 框架 自動 Tellurium


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

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>