Selenium(ThoughtWorks公司開發的web自動化測試載入器)

來源:互聯網
上載者:User

標籤:c   java   a   http   tar   int   

Selenium也是一個用於Web應用程式測試的工具。Selenium測試直接運行在瀏覽器中,就像真正的使用者在操作一樣。支援的瀏覽器包括IE(7、8、9)、Mozilla Firefox、Mozilla Suite等。這個工具的主要功能包括:測試與瀏覽器的相容性——測試你的應用程式看是否能夠很好得工作在不同瀏覽器和作業系統之上。測試系統功能——建立衰退測試檢驗軟體功能和使用者需求。支援自動錄製動作和自動產生 .Net、Java、Perl等不同語言的測試指令碼。Selenium 是ThoughtWorks專門為Web應用程式編寫的一個驗收測試工具。1功能編輯
  • 架構底層使用JavaScript類比真實使用者對瀏覽器進行操作。測試指令碼執行時,瀏覽器自動按照指令碼代碼做出點擊,輸入,開啟,驗證等操作,就像真實使用者所做的一樣,從終端使用者的角度測試應用程式。
  • 使瀏覽器安全色性測試自動化成為可能,儘管在不同的瀏覽器上依然有細微的差別。
  • 使用簡單,可使用Java,Python等多種語言編寫用例指令碼。
 2優勢編輯據 Selenium 首頁所說,與其他測試載入器相比,使用 Selenium 的最大好處是:Selenium 測試直接在瀏覽器中運行,就像真實使用者所做的一樣。Selenium 測試可以在 Windows、Linux 和 Macintosh上的 Internet Explorer、Mozilla 和 Firefox 中運行。其他測試載入器都不能覆蓋如此多的平台。使用 Selenium 和在瀏覽器中運行測試還有很多其他好處。下面是主要的兩大好處:通過編寫模仿使用者操作的 Selenium 測試指令碼,可以從終端使用者的角度來測試應用程式。通過在不同瀏覽器中運行測試,更容易發現瀏覽器的不相容性。Selenium 的核心,也稱browser bot,是用 JavaScript 編寫的。這使得測試指令碼可以在受支援的瀏覽器中運行。browser bot 負責執行從測試指令碼接收到的命令,測試指令碼要麼是用 HTML 的表布局編寫的,要麼是使用一種受支援的程式設計語言編寫的。Selenium 適用於以下瀏覽器:
Browser Selenium IDE Selenium Remote Control Selenium Core Selenium 2/Webdriver API
Firefox 10 Record and playback tests Start browser, run tests Run tests Run tests
Firefox 9 Record and playback tests Start browser, run tests Run tests Run tests
Firefox 8 Record and playback tests Start browser, run tests Run tests Run tests
Firefox 7 Record and playback tests Start browser, run tests Run tests Run tests
Firefox 6 Record and playback tests Start browser, run tests Run tests Run tests
Firefox 5 Record and playback tests Start browser, run tests Run tests Run tests
Firefox 4 Record and playback tests Start browser, run tests Run tests Run tests
Firefox 3.6 Record and playback tests Start browser, run tests Run tests Run tests
Firefox 3 Record and playback tests Start browser, run tests Run tests not supported
IE 9 not supported Start browser, run tests Run tests Run tests
IE 8 not supported Start browser, run tests Run tests Run tests
IE 7 not supported Start browser, run tests Run tests Run tests
Safari 3 not supported Start browser, run tests Run tests not supported
Safari 2 not supported Start browser, run tests Run tests not supported
Opera 9 not supported Start browser, run tests Run tests Run tests
Opera 8 not supported Start browser, run tests Run tests Run tests
Chrome not supported Start browser, run tests*** Run tests*** Run tests***
Others not supported Partial support possible* Run tests** not supported
 3組件編輯
  • Selenium IDE:一個Firefox外掛程式,可以錄製使用者的基本操作,產生測試案例。隨後可以運行這些測試案例在瀏覽器裡回放,可將測試案例轉換為其他語言的自動化指令碼。
  • Selenium Remote Control (RC) :支援多種平台(Windows,Linux,Solaris)和多種瀏覽器(IE,Firefox,Opera,Safari),可以用多種語言(Java,Ruby,Python,Perl,PHP,C#)編寫測試案例。
  • Selenium Grid :允許Selenium-RC 針對規模龐大的測試案例集或者需要在不同環境中啟動並執行測試案例集進行擴充。
 4使用編輯能把Selenium RC指令碼和JUnit單元測試結合起來,既能涵蓋功能測試,又能涵蓋資料或後台Java類測試,從而構成一個完整的Web應用測試解決方案。首先要安裝JRE,從官網(文後參考資料)下載Selenium RC的程式Jar包,存放在硬碟的某個目錄中,如E:/Selenium/ 。啟動Selenium RC服務,啟動cmd模式,進入到selenium RC所在的目錄後,輸入: java -jar selenium-server.jar 。啟動完成後,可以看到以下資訊,即表示啟動成功。  一個學習的網站http://www.51testing.com/zhuanti/selenium.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.