Sie sind auf Seite 1von 9

Selenium is a high quality open source test automation tool for web application testing.

Selenium tests run directly in a browser, just as real users do.


Browser compatibility testing- Test your application to see if it works correctly on different browsers and operating systems. The same script can run on any Selenium platform. System functional testing- Create regression tests to verify application functionality and user acceptance.

Supported Platform and Browser for Selenium

Windows: o Internet Explorer 6.0 o Firefox 0.8 to 2.0 o Mozilla Suite 1.6+, 1.7+ o Seamonkey 1.0 o Opera 8 Mac OS X: o Safari 1.3+ o Firefox 0.8 to 2.0 o Camino 1.0a1 o Mozilla Suite 1.6+, 1.7+ o Seamonkey 1.0 Linux: o Firefox 0.8 to 2.0 o Mozilla Suite 1.6+, 1.7+ o Konqueror
o

There are three variants of Selenium, which can be used in isolation or in combination to create complete automation test suite for your web applications.

How Selenium Works-

Selenium Core - In Selenium Core the tests scripts (written in HTML) and the Selenium Test Runner (written in JavaScript) are uploaded to the same web server that hosts the application you are trying to test. It is a simpler form of Selenium, and suitable for non-developers, but it has some inherent limitations. Selenium Core uses a unique mechanism which allows it to run on so many platforms. Written in pure JavaScript/DHTML, you copy Selenium Core tests directly into your application web server, allowing the tests to run in any supported browser on the client-side. Thus, you must have write access to the machine your web application server is running on to install Selenium Core. Selenium Core was developed by team of programmers and testers at Thought Works (see below). It is open-source software and can be downloaded and used without charge. It is currently under active development by our team. Stay tuned for updates and further announcements. Selenium uses JavaScript and frames to embed a test automation engine in your browser. This technique should work with any JavaScript-enabled browser. Because different browsers handle JavaScript somewhat differently, we usually have to tweak the engine to support a wide range of browsers on Windows, Mac OS X and Linux.

Selenium IDEIs a Firebox addon that records clicks, typing, and other actions to make a test, which you can play back in the browser. Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firebox 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 scripts by hand. With auto complete 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. It provides the simplest introduction to Selenium and is highly recommended for beginners. You can save the tests / test suite created in xml or html format. However to run them in an automated fashion you need Selenium Remote Control which is described next.

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.

Selenium Remote Control - The Selenium Remote Control allows you to develop test cases and test suites in Java (supports JUnit & NGUnit), PHP, Ruby, Python, Perl and even .NET. It is the most flexible setup but requires some development knowledge to set up and use. Runs your tests in multiple browsers and platforms. Tweak your tests in your language. 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. 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 JavaScriptenabled browser? Selenium RC comes in two parts. -A server which automatically launches and kills browsers, and acts as a HTTP proxy for web requests from them. -Client libraries for your favorite computer language. The RC server also bundles Selenium Core, and automatically loads it into the browser 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 Grid - Selenium Grid allows several Selenium Remote Control servers to be accessed in parallel by Selenium Grid server. This is extremely useful for automated load and stress testing of web applications. 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. Selenium Grid is a tool that dramatically speeds up functional testing of webapps by leveraging your existing computing infrastructure. It allows you to easily run multiple tests in parallel, on multiple machines, in an heterogeneous environment. Based on the excellent Selenium web 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, Last but ot least, Selenium Grid is easy to use and simple to install.

Today we will discuss on how you can easily create automatic test scripts using Selenium IDE and convert them to JUnit tests (which uses Selenium Remote Control) which can be added to your JUnit based automatic regression test suite. Run tests in parallel

Selenium Grids aims to allow running tests on multiple computer because: Selenium remote control is quite slow at driving the browser. You can only run a limited number of concurrent tests on the same remote control before seriously impacting its stability. Practically speaking, launching more than 6 browsers on the same Selenium Remote Control is not advisable. The limitations are even more drastic for Internet Explorer. In other words: slow and not scalable. If I correctly understand the documentation, Selenium Grid will allow to run approximatively 6 x N tests in parallel, where N is the number of computers in the grid. Not really impressive. An HtmlUnit user reported that he performed load testing with HtmUnit using 350 threads in the same VM and one WebClient instance per thread. For this purpose he allocated 512M of his 1Gig laptop to the VM and it worked very well. WebTest surely adds some overhead to HtmlUnit pure but, due to the indications of this user, I could imagine that it would be possible to run 500 threads of WebTest tests on one computer within a single VM. This would save just 80 computers compared to Selenium Grid!

Parallelisation often limited

Selenium Grids documentation says: 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. Sadly this isnt that easy. Not all tests can be run in parallel: as soon as you test the functionalities of registered users, youre often limited to a serial test execution (or a just a few parallel executions) when your application doesnt accept numerous simultaneous login of the same user and you dont have so much users available with the right settings for the tests. In this case only pure speed can help. Grid computing is an exciting large area, perhaps is Selenium Grid only a side product of some more significant activity

http://mguillem.wordpress.com/2007/10/ Advantages for Selenium Ide-

Valuable tool which is light weighted and user friendly. It can be used by any technical or non-technical users as well. Selenium IDE is a plugin or call it an extension to Firefox, just like Firebug, Chatzilla but with a different functionality and purpose altogether Basically Selenium IDE records its tests in HTML and then uses those tests to execute through browser. But users can covert HTML script to ruby, php, phython, C# or java by Options->Format.

Disadvantages for Selenium Ide The recording mode plugin is not available for IE.

What does selenium do? You can use open source (i.e. free!) - "selenium" tool (selenium IDE is a plug-in to firefox) to record and playback tests (like WinRunner, QTP). You can then export the recorded test in most language e.g. "html", Java, .net, Perl, ruby etc. The exported test can be run in any browser and any platform using "selenium remote control".

What are the components of selenium? Selenium IDE - Plug-in to Firefox to record and play test in "firefox" and also export tests in different languages. Selenium RC- Allows playing of exported test in different platform/OS Selenium Grid - Allows to control lots of selenium machines. How does Selenium remote control internally works? Selenium RC launches the browser with "itself" as the proxy server (hence you may get certificate warning in some modes) and then it "injects" JavaScript - to play the test. This also means it can easily work in ALL browsers/platform - and it can be "easily" used to test "AJAX"(unlike professional tools).

Where the browser is under the control of another process Drivers exist for Java, .NET, Python, and Ruby The Browser Boot takes instructions from the adjacent process However, JavaScript cannot open sockets (Cross-site scripting issues) The Selenese driver continuously requests pages from the driving process, delivered as plain text This is reply/request (rather than request/reply)

Diffn. Between Selenium ide & RC & Core ? Selenium IDE: Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and allows you to record, edit, and debug tests. Limitations o Browser (Firefox Only) o Language Support (Selenese Only) Selenium RC:

Selenium RC can be used for automating web applications for different web browsers on different platforms using your favorite language like JAVA, C#, Perl, Python, Ruby etc. To write your scripts, you can use Selenium RC with or without Selenium IDE because selenium IDE would help you writing scripts. Limitations o Slow o Limited number of concurrent tests Selenium Core: Selenium Core is a test tool for web applications. Selenium Core tests run directly in a browser, just as real users do. They run in Internet Explorer, Mozilla and Firefox on Windows, Linux, and Macintosh 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.

Das könnte Ihnen auch gefallen