Hi Marc,
I made this change in the code:
function submitFormToMethod(form, method) {
//form.method.value = method;
form.method = method;
form.submit();
}
and received a java.lang.IllegalArgumentException instead. The text of the
exception is:
java.lang.IllegalArgumentException: No method found for [addSave]
In this case the webtest run stops sooner than it was previously. (See full
error and exception below.)
Also, it appears that in order to support IE, we have had to use the original
syntax. I tested the change in IE and could not use the Add button on this
page. The Mozilla derivatives (FF,NS,Moz) and Opera seem to recognize either
setting (form.method=method and form.method.value=method).
Finally, using the original code, I ran a sniffer (wireshark) on my box as I
submitted the request. And I can actually see the 302 come across from the
server. It appears to be at this point that the webtest/htmlunit browser
reports the "302 Moved Temporarily" error.
The full text of the error above from webtest is:
BUILD FAILED
C:\Documents and
Settings\ccopeland\Desktop\canoo-webtest\tests\CRUD-Web_Link.xm
l:16: Canoo Webtest: R_1365.
Test failed.
Test step clickButton (C:\Documents and
Settings\ccopeland\Desktop\canoo-webtest
\tests\CRUD-Web_Link.xml:46: ) named "Click the Add button for Web Links"
faile
d with message "Step[clickButton "Click the Add button for Web Links" (14/19)]:
Script error loading page executing webtest at: clickButton Wrapped
java.lang.Il
legalArgumentException: No method found for [addSave]
(https://172.16.34.36/admi
n/scripts/common.js#668)
Source code:
function () {
[native code, arity=0]
}
"
at
com.canoo.webtest.ant.WebtestTask.stopBuildIfNeeded(WebtestTask.java:
186)
at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:155)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Total time: 46 seconds
>Hi Craig,
>
>are you sure that the problem is a possible infinite loop prevented by
>htmlunit?
>
>Your js code is wrong: it should be
>form.method = method;
>instead of
>form.method.value = method;
>
>Marc.
>
>Craig Copeland wrote:
>> Sure. No problem. It's just a submit call:
>> function submitFormToMethod(form, method) {
>> form.method.value = method;
>> form.submit();
>> }
>>
>> Also, I've found a note in the htmlunit message lists that may be of some
>> help posted by Marc Guillemot. (See below.) It seems that if the same URL
>> is returned, then the code bails out, which is reasonable in order to avoid
>> infinite redirects. However, as Marc suggests maybe a counter would be
>> appropriate to avoid this instead of being quite so literal. I wonder if
>> this has been pushed to a bug yet.
>>
>> http://sourceforge.net/mailarchive/message.php?msg_id=14381525
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest