Wednesday, 20 July 2011

Easy form filler for developer testing

For the last few weeks I've been on the look out for some kind of application that will fill out HTML forms. This is purely for testing purposes. There's nothing more annoying that having to repeatedly fill out long forms in order to test some functionality. I wanted something that was no effort at all. E.g. You fill out a form, click save then the next time you come to a page you can somehow load the saved values.

A quick Google search found the form saver plugin for Firefox. Unfortunately it hasn't been updated for ages and doesn't support Firefox 5. Autofill forms was another plugin I came across but it was also no good. It seems to be designed to fill out fairly standard form fields such as addresses, usernames and passwords. It was a pain in the ass to set up for a custom form fields so it didn't appeal to my lazy sensibilities. 

So, out of ideas I sent an email round at work asking if anyone knew of an application that would do the job. A colleague pointed out that Selenium IDE could be the answer. Jackpot! I've used Selenium IDE before, but I've never thought of using it in this way. It's primarily an automated testing tool. The IDE can record a user's actions, store them in a specified language and then reproduce the actions at the click of a button. This makes it an absolutely perfect tool for quick and dirty developer testing. Load the IDE, hit record, fill out the form as desired, save the test case with some kind of meaningful name, then the next time you want to fill out the form, load the test case and hit run. Even better, steps can easily be inserted, edited or removed in the IDE if your form changes, and, the test cases can be saved as files so can easily be shared. Selenium IDE FTW.