Making QA easier with Selenium

Earlier this week I wrote a summary of a few ways you can automate and test your Javascript, including the use of the Selenium platform by OpenQA. I say platform because there are several very different ways you can use the Selenium family of programs. In this post I’ll expand on the ones I’ve used.

Developer and Regression Testing

Lets face it, testing *that* screen for the 14th time in a row can get pretty tedious, especially if you have to start from a fresh session and go through half a dozen screens on the way there.

That’s where Selenium IDE comes in. SIDE is a Firefox extention that saves you time by allowing you to record a test once in your browser, and save it. You can then replay that test whenever you like, sitting back while Firefox speeds through your test for you. You can also build assertions into your test so that specific conditions will make it fail.

If you build up a library of tests you can run them all as a batch, while you get on with something else.

Continuous Integration Testing

SIDE is great for when you’ve got a developer or tester sitting in front of a browser, but what about automated tests? In a Continuous Integration environment, checking new code into source control triggers a automated build to happen, usually with associated unit tests. That’s all great for classes and modules that suit unit testing, but what about higher-level testing?

That’s where Selenium RC comes in. RC stands for Remote Control, which makes sense when you understand what it does. Selemium RC is a collection of APIs for most popular programming languages that allows your code to control an actual instance of a browser (it supports Safari, IE and Firefox) and run tests against it.

You can set up a build script that runs through your library of regression tests and reports the results back to you. This means that once you’ve recorded a few different runs through one of your website processes, you can then have those tests run automatically whenever someone checks code into source control.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: