[Webtest] Form fields not found

av8r av8r <harman.birdi@gmail.com>
Mon, 8 Sep 2008 16:54:20 -0700 (PDT)


I am trying to automate the testing of our application using webtest, but it
fails for
something we call subpanels in our application. I am able to click on the
button "Create"
to bring up the form, which in the real application will show the form which
few html form fields. I am using htmlunit-2.2 and still experiencing the
problem. Read
in some other threads that this should be resolved in htmlunit-2.2

Canoo webtest recorder is able to pick up the form field but when I use it
in my script,
it is not able to find it. I believe the form itself is generated by some
javascript coding or

The basic test is as below:

<project default="test">
   <target name="test">
       <webtest name="Test 1 - Create, Search, Delete Contact">
                <echo message="Execute login and step"/>
                <clickLink label="Accounts"/>
                <clickLink label="Create Account"/>
                <setInputField htmlId="name" value="Test Account"/>
                <clickButton label="Save" name="button"/>
                <selectForm name="form" id="formformContacts"/>
                <clickButton name="accounts_contacts_create_button"/>
                <selectForm name="form" id="QuickCreate"/>
                <clickButton name="Contacts_subpanel_full_form_button"/>
                <setInputField htmlId="first_name" value="Joe"/>    <===
This is where it fails
                <setInputField name="last_name" value="Hartman"/>
                <clickButton label="Save"/>

I have added couple of screenshots of how it looks before and after the
"account_contacts_create_button" is clicked which opens up the form. I tried
this on Firebug
with Mozilla. Originally, it fails to show the html fields in the form,
complains that the form needs to
be double-posted. Once I click on the Load button for that, it does show
these html form fields.

My question is: How can I force webtest to run post when I want it to,
rather than after clicking on
some button? Also, if this is not the issue what could be causing it?

I would really appreciate if someone can help me resolve this. Its the
gating factor in my automation
efforts here, and I am pulling my hair out over this. Please help.
http://www.nabble.com/file/p19284212/before.JPG before.JPG 
http://www.nabble.com/file/p19284212/after.JPG after.JPG 
View this message in context: http://www.nabble.com/Form-fields-not-found-tp19284212p19284212.html
Sent from the WebTest mailing list archive at Nabble.com.