Automated browser testing the easy way with Minion

What's the best automated testing tool for web applications?

It's a question many have asked and really there is no one answer. There are numerous tools out there which will help in different situations.

There's no doubt that performing integration tests, and testing all the functional aspects of your website before a code release is a necessity. Of the hundreds of potential user journeys within your website you need to be sure a code change hasn't broken anything.

One thing I've found in the past is that creating such tests, whether it be using the Selenium IDE or indeed writing code to automate webdriver is that it is a time consuming process. If you're using webdriver you do need programming experience.

Minion however allows anyone regardless of any programming experience to quickly create automated browser tests.

Taken from the Minion website:

Minion was designed so that any member of a development team can quickly write comprehensive automated browser tests. It's all too often that developers are worried when refactoring code or modifying the code base in case they introduce bugs or breaking changes. With Minion however it's easy to write numerous scripts to functionally test critical areas of your website to ensure you are confident your site works as it should. No compilation is required. The code is simple, please take a look at the example below.

Writing Minion scripts is simple, below is a script I used not too long ago to validate a user journey in a recent project:

CLICK .country-columns .column a 1
CLICK .yellow-button
INPUT #Serial "TEST"
CLICK .yellow-button
JOURNEY AddDetails
CLICK .yellow-button
CLICK #AgreedToTermsAndConditions
CLICK .yellow-button
VERIFY H1 "Thank you"

You can very easily work out for youself what this script does when it is executed. The JOURNEY command executes a another minion script, perhaps a script shared by many user journeys.

Minion commands follow a pattern. First define the command, CLICK, SELECT, INPUT, GOTO etc. Then define the DOM element you want to interact with using Css selectors, Id or even a JQeury selector. The final optional parameter is used if you want to specify a value for example to input into a text box.

You can see writing automated tests in this way is very very fast - and anyone on the team can write them.

I'll write a follow up post shortly about how to integrate Minion with Team City so that all your tests execute as part of a CI setup.

Get Minion at http://www.testminion.com

Dave Leigh

Web, and long time Sitecore developer based in Bristol, UK, working at Valtech - valtech.co.uk - @valtech.
I occasionally do other things too.