AutoSubmitter – simulate multiple form submissions

August 10, 2005 | Uncategorized | Comments Off on AutoSubmitter – simulate multiple form submissions

This week I wanted to run a form simulation to populate a website with a lot of information by submitting a form over and over. I know there are bigger testing frameworks like MS Application Center, but I just wanted something lightweight and easy to use. Here is a sample XML definition for loading the form with values:

<?xml version="1.0"?>
<autoSubmit url="http://localhost/lab/submitter/test01.aspx"" formID="" submitID="SubmitButton" startNumber="10" maximumRounds="10">
 <element id="Name" attributeName="value" value="John" />
 <element id="Email" attributeName="value" value="test+{0}" />
 <element id="EmailMe" attributeName="checked" value="false" />
 <element id="State" attributeName="selectedIndex" value="2" /> 

The url to load is defined by the url property and the startNumber and maximumRounds setup the submission loop. The form is submitting either using a formID (not useful in ASP.NET) or submitID (the ID of the button control you want clicked). The <element> tags define the properties that need to be set on the various form elements on the page. Text inputs can be incrimented using the {0} syntax (see the Email element). The incriment could be used to generate unique username or emails or add a little unique text to the end of a form post if you wanted a lot of new threads in a forum app.  I'm sure there are a million more uses (some not so legitamate) and a lot of expansion possibilities.

Here's a demo screen:

AutoSubmitter Demo

The application embeds an IE object, loads the page, and when the DocumentComplete event fires, it loads the form with values and submits. It then repeats as many times as you ask it to. If anyone wants to expand on this, email me and I'll send you the source.

Comments are closed.

Hi, I'm John Dyer. In my day job, I build websites and create online seminary software for a seminary in Dallas. I also like to release open source tools including a pretty popular HTML5 video player and build tools that help people find best bible commentaries and do bible study. And just for fun, I also wrote a book on the theology of technology and media.

Fork me on GitHub

Social Widgets powered by