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).

14 comments:

Anonymous said...

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.

Anonymous said...

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

Anonymous said...

Thanks

Anonymous said...

Have you seen the excellent Sahi tutorial?

Anonymous said...

Thanx from Hamburg, Germany

Anonymous said...

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.

Anonymous said...

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

Anonymous said...

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

Anonymous said...

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

Thanks

Anonymous said...

This was much useful. thank you!

Anonymous said...

yea bro, thanks...very much appreciated.

Chie Talavera said...

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

trinity said...

Could you please tell me installtion steps for selenium Rc on linux?

Unknown said...

I am comparatively new to selenium and played a little with selenium IDE, and trying to do with selenium rc. I am baffled to use the scripting language there. Can you tell me what is the most used language in selenium across industries? And also I came across this course http://www.wiziq.com/course/12451-selenium-automated-web-browser-testing-for-web-applications os selenium automated web browser testing is this good? If someone does in Java and he joins a company where everyone does in ruby, then it'll be a pain to learn ruby again. And also it would be great if you address any comparison about the available languages like (perl, python, ruby, java etc.) or tell me any other guidance would really appreciate help and also i would like to thank for all the information you are providing. e

Modifying EC2 security groups via AWS Lambda functions

One task that comes up again and again is adding, removing or updating source CIDR blocks in various security groups in an EC2 infrastructur...