[Webtest] calling javascript functions

Kercher, John webtest@lists.canoo.com
Wed, 5 Apr 2006 17:14:46 -0400

Hello all...

We are adding an AJAX-driven table to many of our app's pages.  When the
containing page renders, the onload function triggers an AJAX call to
initially populate the data.  WebTest and HTMLUnit handle this
wonderfully.  We have added a timer to automatically refresh the data so
users are not required to constantly refresh it themselves.  It appears
that HTMLUnit does not include support for the javascript timer object,
so the update calls are not being made.  I'm wondering if there is a way
to call javascript functions defined within page scope, so that I could
call the update function from WebTest rather relying on the javascript
timer (this might actually lead to a more properly controlled test,
since I'll know exactly when updates occur rather than relying on
<sleep> steps and timing).

I saw in the archives someone had asked the same question about a year
ago.  I was wondering if WebTest had been extended to provide this
capability.  It looks like HTMLUnit provides a method called
HtmlPace.executeJavascriptIfPossible(String) that WebTest could pass
arguments to.

Also, is there any word on the progress of just-in-time property

As always, thanks for the help and the hard work...