1 message in com.canoo.lists.webtest[Webtest] submitform and posturl steps
FromSent OnAttachments
Janno Kusman03 Feb 2004 01:24.java, .java
Subject:[Webtest] submitform and posturl steps
From:Janno Kusman (jann@hot.ee)
Date:02/03/2004 01:24:15 AM
List:com.canoo.lists.webtest
Attachments:

Hi,

Here are my two custom steps that I have written to overcome javascript related issues, when submiting forms. For building see my instruction for exportproperty custom task (use mailing-list search). Add following two lines two webtestTaskdefs.properties:

submitform=com.canoo.webtest.extension.SubmitForm posturl=com.canoo.webtest.extension.MakePost

submitform works as clickbutton task and supports formlocator, but submits form directly. Useful for example, if form is submited by long javascript functions, that doesn't work in httpUnit.

posturl was written to make my own custom POST requests. It's also similar to clickbutton, as you can set fields you want to post with setinputfield step. Example:

... <invokeurl url="first_page"/> <setinputfield stepid="Set the input field" name="field1" value="My simple value" />

<posturl stepid="Submit the simple form" url="login" />

<verifytext id="verify that login was succesful" text="Welcome"/> ....

You must use invokeurl before calling setinputfield, or you will receive Error, but the page doesn't need to contain actually a form.

Janno