Tuesday, October 12, 2010

What is Selenium?

Selenium is a suite of tools used to automate web application testing across many platforms. It is an open source tool developed in Java Script and browser technologies and hence supports all the major browsers on all the platforms. It was developed by ThoughtWorks Inc.
  • Web testing tool.
  • Javascript based.
  • Supports the multiple languages for writting the client script.
  • Supports multiple Operating systems.
  • Supports multiple browsers
  • Execute the testcases parallely(in Grid fashion)
Selenium Components

1) Selenium Core:

This is the original JavaScript-based testing system. It is now used primarily as a component of Selenium Remote Control, but it can also be used as a pure JavaScript/HTML testing system. To run Selenium Core tests, they normally have to be installed on the server on which you want to test.

2) Selenium IDE:

Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox (2+) extension, and allows you to record, edit, and debug tests.

Features:

    * Easy record and playback
    * Intelligent field selection using IDs, names, or Xpath, as needed
    * Autocomplete for all common Selenium commands
    * Walk through tests
    * Debug and set breakpoints
    * Save tests as HTML, Ruby scripts, or any other format
    * Support for Selenium user-extensions.js file
    * Option to automatically assert the title of every page

Drawbacks:

    * The biggest drawback of Selenium IDE is its limitation in terms of browser support. Though Selenium scripts can be used for most of the browsers and operating systems, scripts written using Selenium IDE can be used for only the Firefox browser if it is not used with Selenium RC or Selenium Core.
    * Selenese, the simple scripting language used by IDE, is somewhat primitive as it has no conditionals (no “if” statements), and no loops (no “for” statements).
    * Does not help with the launching and closing of the browser

Note: Selenium IDE can be configured to repeat a specific test by using flowControl extensions: goto, While, and so on, by installing the selenium-goto extension (download it from http://wiki.openqa.org/pages/viewpageattachments.action?pageId=379). To install it, open the Options panel in the Selenium IDE browser extension and specify the location of the user-extension.js file.


3) Selenium Remote Control:

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 JavaScript-enabled browser. The RC server also bundles Selenium Core, and automatically loads it into the browser.

Selenium RC comes in two parts:

a) A server, which automatically launches and kills browsers, and acts as a HTTP proxy for web requests from them.

b) Client libraries for your favorite computer language (Java, .NET, Perl, Python, C#, PHP and Ruby).

Click on selenium for a simplified architectural representation.

As a test suite starts, the following happens

    * The client/driver reaches out to the Selenium-Server.
    * The Selenium-Server launches a browser (or reuses an old one) with a URL that will load the Selenium core web page.
    * The Selenium-Core gets the first instruction from the client/driver (via the HTTP Proxy built into the Selenium RC Server).
    * The Selenium-Core acts on that first instruction, typically opening a page of the AUT.
    * The web server is asked for that page, and it renders it in the frame/window reserved for it.

4) Selenium Grid:

Selenium Grid runs tests on many servers at the same time, cutting down on the time it takes to test multiple browsers or operating systems.

Installation:

   1. Selenium IDE:
          * Selenium IDE can be downloaded from http://seleniumhq.org/download/.
          * Open Mozilla Firefox.
          * Drag and drop the file into it.
          * Install it and restart Firefox
          * If installed properly, Selenium can be accessed from Tool –> Selenium IDE in your browser toolbar.
   2. Selenium RC:
          * Selenium RC can be downloaded from http://seleniumhq.org/download/.
          * Unzip the file and extract it in the directory of your choice.
          * JRE 1.5 or higher version should be installed on your machine. To check the version, type the following command at the dos prompt: java -version.

6 comments:

  1. Hello Hemanth,
    The Article on What is Selenium is amazing. It give detail information about it .Thanks for Sharing the information on Selenium Automation Testing. Software Testing Company

    ReplyDelete
  2. The blog gave me idea about the selenium and the components of the selenium are explained in an easy and understandable manner My sincere thanks for sharing this post
    Selenium Training in Chennai

    ReplyDelete
  3. you made some good points there. I did a search on the topic and found most people will agree with your blog. Thanks for Sharing. Want to learn Selenium Training in Bangalore


    Selenium Training in Bangalore

    ReplyDelete
  4. Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Visit here for Penetration testing services

    ReplyDelete