[Webtest] functional tests with canoo: javascript

Michael Parker webtest@lists.canoo.com
Fri, 19 Sep 2003 11:10:52 +0200


Hi all,
I refer to an posting of Dierk of my German question about "Funktionale
Tests mit canoo ..."
I reported a problem with "dynamic" submits without a button.
They are generated by a third party taglib an are realized opposite to my
first opinion in javascript.
Dierk asked me for a html snippet:
[..]
<body>
<form name="ProductForm" method="POST" action="do...."
onsubmit="beforeSubmit()">
[...hiddenfields ... ]
<table>
<tr>
<td>A_in;
<input type="text" name="A_in" value="-1" onchange="
document.ProductForm....value='/dynsub/dynsub.jsp'; beforeSubmit();
document.ProductForm.....value='A_in';ProductForm.submit();" onfocus="
document.ProductForm.....value='@A_in';">
</TD>
<td>A_out
<select name="A_opt" tabindex="4" onfocus="
document.ProductForm.jvpms_nextfocus.value='@A_opt';">
<option value="-1"></option>
<option value="1">Zeile1</option>
<option value="2">Zeile2</option>
<option value="3">Zeile3</option>
</select>
</td>
</tr>
</table>
</form>
<script language="JavaScript">
<!--
function beforeSubmit(){
document.ProductForm.scrollposition.value=self.pageYOffset;
document.ProductForm.last_uri.value=document.ProductForm.currenturi.value;
}
// -->
</script>

Recording to ants-debug output the classes of js.jar are found:
[...]
Class org.mozilla.javascript.TokenStream loaded from ant loader
Finding class org.mozilla.javascript.ObjToIntMap
Class org.mozilla.javascript.ObjToIntMap loaded from ant loader
Finding class org.mozilla.javascript.LabelTable
Class org.mozilla.javascript.LabelTable loaded from ant loader
Finding class org.mozilla.javascript.ClassNameHelper
Class org.mozilla.javascript.ClassNameHelper loaded from ant loader
Finding class org.mozilla.javascript.ClassRepository
Class org.mozilla.javascript.ClassRepository loaded from ant loader
Finding class org.mozilla.javascript.optimizer.OptClassNameHelper
Class org.mozilla.javascript.optimizer.OptClassNameHelper loaded from ant
loader
[...]

Any hints ?

Regards,
Michael