关注质量与体验——电子商务与自动化测试

Selenium——开源的自动化测试框架

上一篇 / 下一篇  2008-08-09 01:10:31 / 个人分类:自动化测试框架

Selenium是一个很好的多平台多浏览器的自动化测试框架,Selenium提供了2种运行模式——Core和Remote Control(RC),除此之外,ThoughtWorks还为Selenium提供了Firefox的Add-on——Selenium IDE以及RC模式的扩展Selenium Grid。现在的版本为Selenium 1.0 beta-1 released (March 5, 2008)

支持的平台和浏览器:

Supported Platforms:

  • Windows:
    • Internet Explorer 6.0 and 7.0
    • Firefox 0.8 to 2.0
    • Mozilla Suite 1.6+, 1.7+
    • Seamonkey 1.0
    • Opera 8 & 9
    • Mac OS X:
      • Safari 2.0.4+
      • Firefox 0.8 to 2.0
      • Camino 1.0a1
      • Mozilla Suite 1.6+, 1.7+
      • Seamonkey 1.0
      Not yet supported: OmniWeb
      • Linux:
        • Firefox 0.8 to 2.0
        • Mozilla Suite 1.6+, 1.7+
        • Konqueror
        • Opera 8 & 9

      Seleniumis a test tool for web applications. Selenium tests rundirectly in a browser, just like real users do. It runs in Internet Explorer, Mozilla and Firefox on Windows, Linux, and Macintosh, Safari on the Mac.  We have plans to target Safari on the iPhone in some months. 

      具体信息可以参见Selenium首页,http://selenium.openqa.org/

      1、Selenium Corehttp://selenium-core.openqa.org/

      Core模式一般是通过编写HTML后加载到要测试的Web程序中

      Core mode: The Javascrīpt core library and the tests in question are loaded into your webapp. It is a simpler form of Selenium, and suitable for non-developers, but it has some inherent limitations. Below is a simplified representation of the architecture.

      Your tests scrīpts (written in HTML) and the Selenium Test Runner itself are uploaded to the same web server that hosts the application you are trying to test.  That suggests that you know how to deploy to that web server (or know someone who does).
      You open a browser at a URL that will kick off the tests, and watch them run by.
      Selenium Core works on muliple browsers - more than the three shown on the left.

      2、Selenium RChttp://selenium-rc.openqa.org/

      The Remote Control mode is more advanced. It is able to test a wider range of web-applications than Selenium-Core and is more scalable, but requires some technical knowledge to set up.  Below is a simplified architectural representation of it ..

      RC模式可以通过多种编程语言支持驱动客户端浏览器,

    • - Java
    • - .NET
    • - Perl
    • - PHP
    • - Python
    • - ruby
    • - Selenese
    • - Javascrīpt

      最主要的是还能支持AJAX应用程序(The Selenium Server is great for testing complex AJAX-based web user interfaces under a Continuous Integration system. It is also an ideal solution for users of Selenium Core or Selenium IDE who want to write tests in a more expressive programming language than the Selenese HTML table format customarily used with Selenium Core.)

      Selenium Remote Control(RC) is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream Javascrīpt-enabled browser.

      Selenium RC comes in two parts. 

      1. A server which can automatically launch and kill supported browsers, and acts as a HTTP proxy for web requests from those browsers.
      2. Client libraries for your favorite computer language.

      3、Selenium Gridhttp://selenium-grid.openqa.org/

      Selenium Grid is a tool that dramatically speeds up functional testing of web-apps by leveraging your existing computing infrastructure. It allows you to easily run multiple tests in parallel, on multiple machines, in an heterogeneous enviroment. 

      This additional server piece allows the several Remote Control servers to accessed in parallel by one or more driving processes.  You may want to do this if you want to use scale to speed everything up, or because you need to test on Mac and/or Linux, as well as Windows from one driving test-suite.

      Based on the excellentSeleniumweb testing tool, Selenium Grid allows you to run multiple instances of Selenium Remote Control in parallel. Even better, it makes all these Selenium Remote Controls appear as a single one, so your tests do not have to worry about the actual infrastructure. Selenium Grid cuts down on the time required to run a Selenium test suite to a fraction of the time that a single instance of Selenium instance would take to run.

      Of course, you get to choose which language you develop your tests in: Ruby, Java, Python, C#, PHP, ...

      4、Selenium IDEhttp://selenium-ide.openqa.org/

      Selenium IDEis an integrated development environment forSeleniumtests. It is implemented as a Firefox extension, and allows you to record, edit, and debug tests. Selenium IDE includes the entire Selenium Core, allowing you to easily and quickly record and play back tests in the actual environment that they will run.

      Selenium IDE is not only recording tool:it is a complete IDE. You can choose to use its recording capability, or you may edit your scrīpts by hand. With autocomplete support and the ability to move commands around quickly, Selenium IDE is the ideal environment for creating Selenium tests no matter what style of tests you prefer.

      Features:

      • Easy record and playback
      • Intelligent field selection will use IDs, names, or XPath as needed
      • Autocomplete for all common Selenium commands
      • Walk through tests
      • Debug and set breakpoints
      • Save tests as HTML, Ruby scrīpts, or any other format
      • Support for Seleniumuser-extensions.jsfile
      • Option to automatically assert the title of every page

      This Firefox plugin allows you to record and playback tests in the browser.  Here is a screen shot of it in use (in the side-bar of Firefox):

      目前Selenium IDE有了支持Firefox 3.0的版本,

      Version 1.0 Beta 2

      http://selenium-ide.openqa.org/download.jsp

      5、ThoughtWorks

      Selenium是由ThoughtWorks团队开发的开源自动化测试框架,http://www.thoughtworks.com.cn/,ThoughtWorks是一个全球IT咨询公司。交付客户定制应用软件,提供注重实效的咨询服务,为企业开发软件,帮助企业敏捷开发。

      Selenium was developed by team of developers and testers atThoughtWorks. It is open-source software and can be downloaded and used without charge. It is currently under active development developers from multiple companies. Seewho made Seleniumfor more details.
      ThoughtWorksis a leader in Agile development methods for enterprise software development. Selenium is designed specifically for the acceptance testing requirements of Agile teams. However, teams using more traditional development will also find it useful.

    • OscarXie.net

      关注质量与体验——电子商务与自动化测试
      http://www.cnblogs.com/oscarxie/


      TAG: 自动化测试框架

       

      评分:0

      我来说两句

      我的栏目

      日历

      « 2024-05-16  
         1234
      567891011
      12131415161718
      19202122232425
      262728293031 

      我的存档

      数据统计

      • 访问量: 4734
      • 日志数: 6
      • 建立时间: 2008-08-09
      • 更新时间: 2008-08-09

      RSS订阅

      Open Toolbar