Testing Form Submit Statements

 

images\img00040.gif

 

To test submitting a web form, double-click the Form Node in the tree in the left pane. This will launch the form properties dialog.

 

images\img00041.gif

 

The General tab of the form properties dialog shows you the form id, method and action url. The Method will be either POST or GET. If it is POST, you will need to use a form submit task. If the Method is GET, you can save yourself some effort and use a download task instead. The reason is that the GET method takes all of the values you enter in the form and passes them in the Url’s querystring. Google is a good example of a form with a GET statement. Submitting a search on Google.com for "Velocityscape" is exactly the same as navigating to the url http Why? Because the form on Google.com uses the GET method.

 

images\img00042.gif

 

The XML Template tab displays an xml-style form submit statement for the current form. The statement displayed has default values only, and you will probably need to make changes to get the form to work properly.

 

images\img00043.gif

 

The Query Template tab displays a querystring style form submit statement for the current form. You would need to change these values as well.

 

images\img00044.gif

 

If we needed to view the source for the form, not the entire page, the HTML Source tab is the place to see it. Now, let’s get to the business of testing this form. We are going to use the xml-style template.

 

images\img00045.gif

 

Click the ‘Test’ link to launch the test dialog.

 

images\img00046.gif

 

In the Form Submission Testing dialog, we need to edit the form submit statement to reflect the actual submission we want to do. In this case, we are going to search for all 7Elevens in the ‘85331’, regardless of any other attributes. The first thing we can do ic completely remove the Reset/Clear button control from the statement. Next we need to change the value of the contrJimddress_txtZip control from ‘’ to ‘85331’. Finally, we can change the value of the 3 ‘...searchAttribute’ checkbox controls from ‘on’ (which means checked) to ‘off’. Now we are ready to Test, but first let’s look at what is under the Advanced button.

 

images\img00047.gif

 

The advanced button launches the Http Client Properties dialog. This window allows us to set properties of the Http Client including User Agent, Referrer Url, Relative Url, Clear Text Authentication Credentials, and Cookies. Normally, you can leave these as their default values. Click OK to return to the Form Submission Testing dialog.

 

images\img00048.gif

 

We are ready to test our form submit statement, so we click ‘Test’. This submits the form using the criteria we specified, and launches the results in a new browser window.

 

images\img00049.gif

 

…and it is successful. Now, we can take the form submit statement that we have built and use it in a form submit task to automate and vary the parameters of the search, over and over again.