[Webtest] WebTest Cookbook

Nate Oster Nate Oster" <noster@numbersix.com
Fri, 8 Dec 2006 10:35:32 -0500


This thread about using Groovy to temporarily suppress JS exceptions is
fantastic.  However, I think it highlights the need for WebTest to be
more "packaged" for new users.  I know there are several open JIRA
issues about this.

For example, most of us "end users" of WebTest don't have detailed
HTMLUnit knowledge - that's why we use WebTest!  :) =20

WebTest provides a simple, declarative, procedural layer of abstraction
on top of HTMLUnit.  Most WebTesters aren't familiar with all the
available HTMLUnit settings.  One way to help users take advantage of
Groovy scripting would be to create a cookbook of common solutions like
the one below - perhaps even including them as examples with the
distribution (or optionally with the distribution).  Maybe the wiki is
the right place for this, but it seems to be little-used.

As 2.3 or 3.0 or whatever the next version is takes shape, it would be
really nice to poll this list for the design of an ideal WebTest
distribution package that would help new users get productive

Congrats on your presentation at iX Bessere Software Konferenz!

Nate Oster

Message: 4
Date: Thu, 07 Dec 2006 17:26:18 +0100
From: Marc Guillemot <mguillemot@yahoo.fr>
To: webtest@lists.canoo.com
Subject: Re: [Webtest] Script exception with JS Enabled...
Reply-To: webtest@lists.canoo.com
Reply-To: Marc Guillemot <mguillemot@yahoo.fr>

as long as you don't have a fixed version, you can "locally ignore" the=20
js errors with something like:

<groovy description=3D"don't react on js script errors">
     step.context.webClient.throwExceptionOnScriptError =3D false
... your page invocation here ...
<groovy description=3D"react on js errors again as this webtest should=20
verify the quality of the application">
     step.context.webClient.throwExceptionOnScriptError =3D true