Weve all had a web application that works in such a way that you are required to complete two or three steps in a workflow to get to the specific page youre currently developing. Its a pain to fill out all those required fields, some with complicated regular expression validations (e.g. credit card numbers, e-mail addresses, phone numbers, etc.). It sucks. You have automated acceptance tests, but right now, youre just exploring with some JavaScript or server code.
So what do you do? What is the normal answer to a boring, repetitious problem. Automate it baby! Its not that hard at all. In acceptance testing Im a big fan of not using the record-and-play type automation. I like seeing the detailed chatter between the browser and the server, but for this throw away situation its perfectly fine.
There are two tools that Ive used to record browser interactions; Selenium IDE and iMacros. Actually, now that I think about it, there are two more; ACT and VSTS Web Tests. Im going to ignore the last two because I dont find them very friendly and ill suited for what Im doing.
Between the two main options, Selenium IDE and iMacros, I use iMacros only because of its nicer integration with Firefox. I like the docked sidebar window with all the scripts Ive recorded as opposed to Selenium IDEs floating window and needing to load a test suite before being able to run a test. With that said, I do drive all automated acceptance tests with Selenium. The IDE is very useful, the API to interact with the browser has allows all the control I need. I am very happy with it.
iMacros gives me one button to click to show my scripts.
Then a double click takes me where I need to go; simple, fast, efficient.
Recording the scripts are just as easy; click record, use the browser, stop and save.
iMacro does have the assertions that Selenium IDE has, but in this scenario, I dont care. I dont want to run any assertions, I just want to get where Im going. iMacros has a few other useful scenarios in our organization:
- Quick smoke test of problem areas
- Pre compile pages after deploying website
These two scenarios are probably better served by Selenium and automated through our build server, but it is really simple to setup a script to do whatever you need it to do. Dont discount its power.