[Webtest] Re: java.lang.NullPointerException XmlResultConverter.java:188

Denis N. Antonioli webtest@lists.canoo.com
Mon, 3 Oct 2005 09:26:07 +0200


Hi Ivan

you structured your test as follow:

<project name="add-one-customer" basedir="." default="login">
</project>
<target name="login">
<webtest name="login">
<!-- go to login page and log in to the web application -->
</webtest>
</target>

<target name="addCustomer" depends="login">
<webtest name="addCustomer">
<!-- adds a new customer to the web application -->
</webtest>
</target>

You're using ant dependency mechanism to execute the login procedure  
before using the web application functionality.

This is a good idea, but webtest doesn't support it (yet?) :-(

In webtest, all the steps inside a <webtest>...</webtest> (or  
<testSpec>...</testSpec>) build an independent and closed browsing  
session. In this instance, the webtest "addCustomer" doesn't know  
anything about the webtest "login", so it fails on the first step,  
because it doesn't have the last page of the login process to work on.

The webtest solution to this problem is to extract common code into  
xml entities.
See the documentation (<http://webtest.canoo.com/manual/ 
samples.html#Putting it all together>).


Happy testing
     dna

-- 
Beware of the bugs in the above code;
I have only proved it correct, not tried it.
   -- Donald Knuth