Vous êtes sur la page 1sur 7

What is Selenium? Selenium is a portable software testing framework for web applications.

Selenium provides a record/playback tool for authoring tests without learning a test scripting language (Selenium IDE). It also provides a test domain-specific language (Selenese) to write tests in a number of popular programming languages, including C#, Java, Groovy, Perl, PHP, Python and Ruby. The tests can then be run against most modern web browsers. Selenium deploys on Windows, Linux, and Macintosh platforms. Languages Supported? C#, Java, Perl, PHP, Python, Ruby Programming languages are supported through Selenium Remote Control "drivers." These are libraries made for each language that expose commands from the Selenium API natively in the form of methods/functions. Browsers Supported? Browser Firefox 6 Firefox 5 Firefox 4 Firefox 3 IE 9 IE 8 IE 7 Safari 3 Safari 2 Opera 9 Opera 8 Record tests Record tests Record tests and and and Selenium IDE Selenium RC Start browser, run tests playback Start browser, run tests playback Start browser, run tests playback Start browser, run tests Start browser, run tests Start browser, run tests Start browser, run tests Start browser, run tests Start browser, run tests Start browser, run tests Start browser, run tests Selenium Core Run tests Run tests Run tests Run tests Run tests Run tests Run tests Run tests Run tests Run tests Run tests

not supported not supported not supported not supported not supported not supported not supported

Operating Systems? Windows, OS X, Linux, Solaris. Essential components of selenium? Selenium IDE Selenium Client API Selenium Remote Control Selenium Web Driver

Selenium Grid

How selenium works?

Selenium IDE:

Selenium IDE is an integrated development environment for Selenium scripts. 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. Scripts are recorded in Selenese, a special test scripting language for selenium. Selenese provides commands for performing actions in a browser (click a link, select an option), and for retrieving data from the resulting pages. 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 scripts, or any other format Support for Selenium user-extensions.js file Option to automatically assert the title of every page Easy customization through plugins

Selenium Remote Control (RC): 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. RC Components The Selenium Server which launches and kills browsers, interprets and runs the Selenese commands passed from the test program, and acts as an HTTP proxy, intercepting and verifying HTTP messages passed between the browser and the AUT. Client libraries which provide the interface between each programming language and the Selenium RC Server.

The diagram shows the client libraries communicate with the Server passing each Selenium command for execution. Then the server passes the Selenium command to the browser using Selenium-Core JavaScript commands. The browser, using its JavaScript interpreter, executes the Selenium command. This runs the Selenese action or verification you specified in your test script.

Selenium Server:

Selenium Server receives Selenium commands from your test program, interprets them, and reports back to your program the results of running those tests. The RC server bundles Selenium Core and automatically injects it into the browser. This occurs when your test program opens the browser (using a client library API function). Selenium-Core is a JavaScript program, actually a set of JavaScript functions which interprets and executes Selenese commands using the browsers built-in JavaScript interpreter. The Server receives the Selenese commands from your test program using simple HTTP GET/POST requests. This means you can use any programming language that can send HTTP requests to automate Selenium tests on the browser.

Client Libraries: The client libraries provide the programming support that allows you to run Selenium commands from a program of your own design. There is a different client library for each supported language. A Selenium client library provides a programming interface (API), i.e., a set of functions, which run Selenium commands from your own program. Within each interface, there is a programming function that supports each Selenese command. The client library takes a Selenese command and passes it to the Selenium Server for processing a specific action or test against the application under test (AUT). The client library also receives the result of that command and passes it back to your program. Your program can receive the result and store it into a program variable and report it as a success or failure, or possibly take corrective action if it was an unexpected error.

Selenium Webdriver: Selenium WebDriver is the successor to Selenium RC. Selenium WebDriver accepts commands (sent in Selenese, or via a Client API) and sends them to a browser. This is implemented through a browser-specific browser driver, which sends commands to a browser, and retrieves results. Most browser drivers actually launch and access a browser application (such as Firefox or Internet Explorer); there is also a HtmlUnit browser driver, which simulates a browser using HtmlUnit. Unlike in Selenium 1, where the Selenium RC server was necessary to run tests, Selenium WebDriver does not need a special server to execute tests. Instead, the WebDriver directly starts a browser instance and controls it. However, Selenium Grid can be used with WebDriver to execute tests on remote systems. You may, or may not, need the Selenium Server, depending on how you intend to use Selenium. If you will be strictly using the WebDriver API you do not need the Selenium Server.

The Selenium Server provides Selenium-RC functionality, which is primarily used for Selenium 1.0 backwards compatability. Since WebDriver uses completely different technology to interact with the browsers, the Selenium Server is not needed. Selenium-WebDriver makes direct calls to the browser using each browsers native support for automation. Selenium-RC however requires the Selenium- Server to inject javascript into the browser and to then translate messages from your test programs language-specific Selenium client library into commands that invoke the javascript commands which in turn, automate the AUT from within the browser. In short, if youre using Selenium-WebDriver, you dont need the SeleniumServer. Another reason for using the Selenium-Server is if you are using SeleniumGrid for distributed exectution of your tests. Finally, if you are using Selenium-backed Web-Driver (the WebDriver API but with back-end Selenium technology) you will also need the Selenium Server.

Selenium Grid: Selenium Grid is a server that allows tests to use web browser instances running on remote machines. With Selenium Grid, one server acts as the hub. Tests contact the hub to obtain access to browser instances. The hub has a list of servers that provide access to browser instances (WebDriver nodes), and lets tests use these instances. Selenium Grid allows to run tests in parallel on multiple machines, and to manage different browser versions and browser configurations centrally (instead of in each individual test).

Advantages of Selenium: Choice of using language of your choice. Open Source Script once, Run on multiple browsers Inherent applicability to AJAX Support multiple test frameworks

Disadvantages of Selenium: Supporting non-web applications Maintenance readiness is not inbuilt

QTP Vs Selenium: The price of HP QTP could be an issues for some companies, unfortunately the company has to spend almost $10,000 dollars per floating QTP license. In the same time HP QTP license price may be not an issues for the start up company which just got the new round of money from the venture capitalist or for investment banks where managers want to invest only in the brand name tools. On the other side Selenium is completely free open source test automation tool. It means if QA Testers wants to add Selenium to skill set, the tester may just download Selenium for free, download manual and start exploring the functionality of a test automation tools. The same approach would not be productive with HP QTP download, the free trial version of QuickTest Pro requires tedious registration, works only for 30 days which is often not enough for extensive evaluation by the team. Even after the company paid the hefty price for HP QTP license it would require perplexing installation and configuration of the QTP license server, especially in the case when QA manager wants to take of advantage of QTP floating licenses and share them with the offshore testing team. Some QA manager may wrongly assume that the team will get good return of investment by getting official technical support from HP for QTP. Unfortunately in many cases it is easier and faster to get QTP question answered and problem solved with a help of huge community of users and forums. If QA Team finds any problems using Selenium, there are several places where they can search for help for example active official user group Selenium. There are also several companies that can provide hands-on, expert support with Selenium tool. HP QTP training on the various topics is available from HP Software Education Services and the current price is $3750 for five days course called QuickTest Professional 10: Essentials. There are also several companies and individuals who can provide QTP training and education for more affordable price. Selenium training covering fundamentals and advanced Selenium features is available from various companies in the form of offsite or onsite training and usually prices around $750 for two days course.

Vous aimerez peut-être aussi