A
AS
Hi all,
I've just tried to test a web application with HTTPUnit but seem to
have encountered an obstacle I can't overcome.
The webpage relies strongly on JavaScript (well, which one doesn't
nowadays?), for example by calling JavaScript functions instead of
containing traditional anchors. No rocket science involved, in fact.
However, after I'd found it impossible to follow such a link with
HTTPUnit:
java.lang.RuntimeException: No such property: name at
com.meterware.httpunit.scripting.ScriptableDelegate.set(ScriptableDelegate.java:99)
at com.meterware.httpunit.FormControl$Scriptable.set(FormControl.java:391)
at
com.meterware.httpunit.TextFormControl$Scriptable.set(FormControl.java:793)
at
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.put(JavaScript.java:275)
at
org.mozilla.javascript.ScriptableObject.putProperty(ScriptableObject.java:1476)
at org.mozilla.javascript.ScriptRuntime.setProp(ScriptRuntime.java:842)
I found a single post in HTTPUnit's mailing list stating that it's
impossible to set fields in JavaScript, only to read fields.
(http://sourceforge.net/mailarchive/forum.php?thread_id=2817744&forum_id=5833)
I must confess I can't believe it's true - I can't imagine so many
people using (and praising) HTTPUnit if it doesn't implement this basic
and crucial functionality.
Has anyone encountered a similar problem before?
Thanks for any help,
Anna Skawinska
I've just tried to test a web application with HTTPUnit but seem to
have encountered an obstacle I can't overcome.
The webpage relies strongly on JavaScript (well, which one doesn't
nowadays?), for example by calling JavaScript functions instead of
containing traditional anchors. No rocket science involved, in fact.
However, after I'd found it impossible to follow such a link with
HTTPUnit:
java.lang.RuntimeException: No such property: name at
com.meterware.httpunit.scripting.ScriptableDelegate.set(ScriptableDelegate.java:99)
at com.meterware.httpunit.FormControl$Scriptable.set(FormControl.java:391)
at
com.meterware.httpunit.TextFormControl$Scriptable.set(FormControl.java:793)
at
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.put(JavaScript.java:275)
at
org.mozilla.javascript.ScriptableObject.putProperty(ScriptableObject.java:1476)
at org.mozilla.javascript.ScriptRuntime.setProp(ScriptRuntime.java:842)
I found a single post in HTTPUnit's mailing list stating that it's
impossible to set fields in JavaScript, only to read fields.
(http://sourceforge.net/mailarchive/forum.php?thread_id=2817744&forum_id=5833)
I must confess I can't believe it's true - I can't imagine so many
people using (and praising) HTTPUnit if it doesn't implement this basic
and crucial functionality.
Has anyone encountered a similar problem before?
Thanks for any help,
Anna Skawinska