In firefox, I can exectue "http://XXXXXXXXXXXXXX:8080/myapp/INTEGRATIONSERVLETTEST/INTEGRATIONSERVLETTEST?foo=hello&bar=world&action=TESTACTION" All looks ok, I get the response back that I expect.
output from hitting action
my tcpip monitor is showing that I am pulling myForm.html When I run the unitest.
When I add debug statements for any param they show up correctly.
my ethernet sniffer shows no request to myapp/INTEGRATIONSERVLETTEST/INTEGRATIONSERVLETTEST
I get a null pointer exception at the testform.submit().
My reading of the WebForm api is that WebForm.submit() will submit the form to the server at the address in the form action attribute. Any idea what I am doing wrong???
CIAO Peter M. Cooke
peter cooke
Ranch Hand
Joined: Mar 16, 2004
Posts: 310
posted
0
The test started working when I put in values for all html inputs.
So if I have a html form and it does not require all inputs to have data. Why does httpunit?
Is there somehting wrong with the form or my testcode that says "yes I know the form does not have values for all input. submit it anyways"
Siitesh Hind
Ranch Hand
Joined: Sep 06, 2012
Posts: 51
posted
0
Can you assign some default values for some_param and another_param in the html and test?
peter cooke
Ranch Hand
Joined: Mar 16, 2004
Posts: 310
posted
0
the business requirements say that some_param and another_param are completely optional. If user does not put anything in then ... put null in db.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35223
7
posted
0
Even if the user doesn't enter anything into those fields, they are still being transmitted.
HMMMM my ethernet sniffer confirms that unless my form has all of it's input elements populated it will not go accross the wire.
If I have assignments for both everything works and I see the request/response in my ethernet sniffer.
I remove the assignment of the value from either "some_param" or "another_param" my ethernet sniffer does NOT detect the request from the submit, and submit fails with a null pointer exeception in
com.meterware.httpunit.protocol.MimeEncodedMessageBody$MimeEncoding.fixLineEndings(MimeEncodedMessageBody.java:113)
Siitesh Hind
Ranch Hand
Joined: Sep 06, 2012
Posts: 51
posted
0
Agree with Ulf that you are passing Null values in these 2 fields which may be the source of the exception.