.comment-link {margin-left:.6em;}

Agile Testing

Tuesday, April 04, 2006

30-second Selenium installation tutorial

For people new to Selenium, here's a 30-second (32.78 seconds to be precise) tutorial on how to install Selenium on a Linux box running Apache. I'll assume the DocumentRoot of the Apache installation is /var/www/html.

1. Download Selenium from openqa.org. The latest release of Selenium as of this writing is 0.6.
2. Unzip selenium-0.6.zip and cd into the selenium-0.6 directory.
3. Move or copy the selenium sub-directory somewhere under the DocumentRoot of your Apache server.

That's it -- you have a working Selenium installation!

Here's a screencast which contains the above steps. As I said, it took me 32.78 seconds to do all these things, and almost of all of that time was taken by the download of the zip file: QuickTime format and AVI format.

Now that you've installed Selenium, you might wonder what's your next step. Easy: open the following URL in a browser: http://www.yoursite.com/selenium/TestRunner.html ; you'll see the default test suite that is used to test Selenium itself. Click on the All button in the Control Panel frame on the right, and all the tests in the suite will be executed one by one. If you want to run only a specific test, click on that test name, then click Selected instead of All in the Control Panel.

Again, pictures are worth many words, so here's a screencast of running the default test suite in Firefox: QuickTime format (warning: 28 MB file) and AVI format. Note that some tests involving pop-up windows are failing, because Firefox doesn't allow pop-ups.

Next question: how do you write your own test? A Selenium test is basically an HTML file containing a table with Selenium commands and assertions. The default tests and test suite are in /selenium/tests. You can take any file that starts with Test as a model for writing your own tests. To create a test suite, just create a file similar to the default TestSuite.html, and include links to your custom tests. Assuming you created CustomTestSuite.html, you can see it in the TestRunner page by going to this URL: http://www.yoursite.com/selenium/TestRunner.html?test=./tests/CustomTestSuite.html

For more introductory articles on Selenium, see the Getting Started section of the OpenQA Selenium Wiki.

Update: At Jason Huggins's suggestion, here is a screencast that shows the whole enchilada -- downloading Selenium, installing it and running the default test suite. The whole thing takes a mere 2 minutes and 12 seconds: Quicktime format (warning: 36 MB file), Windows Media format (1 MB file), AVI format (8 MB file).

12 Comments:

  • May I know how to work with selenium. The startup and record and playback and running the script and viewing results etc.

    Pl do give explanations on these things.

    By Anonymous Anonymous, at 1:39 AM  

  • thanks for taking the time to create those quicktime vids on selenium. much appreciated :)

    By Anonymous Jim Plush, at 10:40 AM  

  • Thanks

    By Anonymous Satish, at 2:10 AM  

  • Have you seen the excellent Sahi tutorial?

    By Anonymous Anonymous, at 5:01 AM  

  • Thanx from Hamburg, Germany

    By Anonymous Anonymous, at 8:05 AM  

  • This is very useful. Can you please, provide inputs as how to find the documentroot of the weblogic 9.1 for installing selenium? I am struggling with this. Quick response is highly appreciated.

    Thanks.

    By Anonymous Anonymous, at 6:32 AM  

  • Can you please, provide inputs as how to find the documentroot of the weblogic 9.1 for installing selenium? I am struggling with this. Quick response is highly appreciated. Can you please provide details steps for installing Selenium core on Weblogic 9.1?

    Thanks

    By Anonymous GN, at 2:24 AM  

  • Can you please, provide inputs as how to find the documentroot of the weblogic 9.1 for installing selenium? I am struggling with this. Quick response is highly appreciated. Can you please provide details steps for installing Selenium core on Weblogic 9.1?

    Thanks

    By Anonymous GN, at 2:25 AM  

  • At last I have found solution for installing Selenium core Weblogic. Will soon post these steps on my blog and distribute this.

    Thanks

    By Anonymous GN, at 4:30 AM  

  • This was much useful. thank you!

    By Anonymous Anonymous, at 3:34 AM  

  • yea bro, thanks...very much appreciated.

    By Anonymous Anonymous, at 12:33 PM  

  • i have no knowledge regarding automation testing and i want to start with selenium.

    i already install the bromine and added the 4444 port.

    now i want to connect my RC to bromine to log the event.

    i already downloaded the RC selenium and core but i dont know how to install them and connect it to bromine


    could you help me,thanks

    By Blogger Chie Talavera, at 11:00 PM  

Post a Comment

Links to this post:

Create a Link

<< Home