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

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

  • <strong id="5koa6"></strong>
  • 強大的Web開源測試工具—Selenium

    發表于:2015-12-08來源:uml.org.cn作者:不詳點擊數: 標簽:selenium
    Selenium 是 ThoughtWorks 專門為 Web 應用而開發的自動化測試工具,適合進行功能測試、驗收測試,其最大的優勢有幾點:

      介紹

      Selenium 是 ThoughtWorks 專門為 Web 應用而開發自動化測試工具,適合進行功能測試、驗收測試,其最大的優勢有幾點:

      <!--[if !supportLists]-->1) <!--[endif]-->可直接運行在瀏覽器之上,所見即所得,就像真實用戶所做的一樣。Selenium 的核心,也稱 browser bot,是用 JavaScript 編寫的。這使得測試腳本可以在受支持的瀏覽器中運行。browser bot 負責執行從測試腳本接收到的命令

      <!--[if !supportLists]-->2) <!--[endif]-->支持多操作系統(Windows, Mac OS和Linux)和各種瀏覽器Internet Explorer、Mozilla 和 Firefox,更容易發現瀏覽器的不兼容性

      <!--[if !supportLists]-->3) <!--[endif]-->支持兩種開發腳本的模式test runner (HTML文件)和 driven(腳本語言編寫),其語言包括Java, .NET, Perl, Python 和 Ruby. 使用 driven 腳本,測試有一部分在瀏覽器之外運行,而如果使用 test runner 腳本的話,測試是完全在瀏覽器中運行的。

      但是Selenium是輕量的測試框架, 腳本所處理的測試用例構成簡單,其實質就是通過HTTP協議,發送請求(request)來完成測試用例,所以很困難處理業務邏輯關系強的測試用例。

      更多的討論: http://forums.openqa.org/index.jspa

      Selenium 命令

      Selenium 命令分成兩類 —— 操作(action) 和斷言(assertion):

      * 操作模擬用戶與 Web 應用程序的交互。例如,單擊一個按鈕和填寫一個表單,這些都是常見的用戶操作,可以用 Selenium 命令來自動化這些操作。

      * 斷言驗證一個命令的預期結果。常見的斷言包括驗證頁面內容或當前位置是否正確。

      在 Selenium 網站上可以找到可用命令的完整列表。通過 Selenium 命令,腳本編寫者可以描述 browser bot 在瀏覽器中所執行的操作

      組成

      * Selenium IDE:一個firefox的plug-in,可以錄制和回放并保存一些test cases, 可以生成一些簡單的基于rc 模式的簡單code. (相當于Jmeter的gui模式和jmeter腳本的生成-badboy)

      * Selenium Core. 整個測試機制的核心部分,即有assertion(斷言) 機制的test suite runner。它由一些純js代碼組成, 可以運行在windows/linux的不同browser上 (相當于Jmeter 的runner 跟 Assertion)

      * Selenium Remote Control:一個代理與控制端, 可代替Selenium core/ Selenium IDE的client端(相當于通過編程來實現一切),是支持多語言的. (相當于Jmeter的client/server模式,但Selenium Remote Control更強一些)

      支持的平臺

      Windows:

      o Internet Explorer 6.0

      o Firefox 0.8 to 1.5, Mozilla Suite 1.6+, 1.7+

      o Seamonkey 1.0, Opera 8

      Mac OS X:

      o Safari 1.3+

      o Firefox 0.8 to 1.5, Mozilla Suite 1.6+, 1.7+

      o Seamonkey 1.0, Camino 1.0a1

      Linux:

      o Firefox 0.8 to 1.5, Mozilla Suite 1.6+, 1.7+

      o Konqueror

      部署Selenium

      下載地方:http://www.openqa.org/selenium/

      selenium目錄下的內容:

      <!--[if !supportLists]-->l <!--[endif]-->devtests:試驗性功能 dom-images: 查看DOM用圖片

      <!--[if !supportLists]-->l <!--[endif]-->dom-styles: 查看DOM用樣式表

      <!--[if !supportLists]-->l <!--[endif]-->html-xpath: Xpath庫

      <!--[if !supportLists]-->l <!--[endif]-->jsmock: javascript mock library

      <!--[if !supportLists]-->l <!--[endif]-->jsunit: javascript unit test library

      <!--[if !supportLists]-->l <!--[endif]-->tests: samples(以這個為基礎開發測試用例)

      <!--[if !supportLists]-->l <!--[endif]-->核心js文件和html文件

      <!--[if !supportLists]-->l <!--[endif]-->如果想要測試自己開發的發布在服務器端的頁面,需要把selenium配置在同一個服務器下: Apache :直接將selenium目錄拷貝至htdocs(Apache的確省根目錄)目錄下,然后啟動Apache,用地址http://server:8080/selenium/TestRunner.html訪問例子。

      <!--[if !supportLists]-->l <!--[endif]-->Tomcat :直接將selenium目錄拷貝至webapps目錄下,啟動Tomcat,用地址http://server:8080/selenium /TestRunner.html訪問例子。:

      <!--[if !supportLists]-->l <!--[endif]-->IIS:建立一個虛擬目錄selenium,將該虛擬目錄直接指向實際的selenium目錄,用地址 http://server/selenium/TestRunner.html訪問例子

      Test runner 腳本開發模式

      Selenium test runner 腳本,就是測試用例(test case),是用 HTML 語言通過一個簡單的表布局編寫的,即使對于非技術人員來說,test runner 腳本也易于閱讀和編寫。如 清單 1 所示。

    原文轉自:http://www.uml.org.cn/Test/200607285.htm

    ...
    老湿亚洲永久精品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>