[Webtest] RE:

Dierk König webtest@lists.canoo.com
Fri, 22 Mar 2002 09:02:32 +0100


Hi Rodolfo,

This is an interesting test problem.

The problem here is not really the html, form, button or frames, but the
javascript. I actually see no way to test this via webtest, and even
using httpunit directly would be hard.

Anyway, I set out this challenge to the other members of the mailinglist.

The only clean way I see, is to restructure your WebApp.
This is a typical feedback that tests can give you:
When testing becomes really hard, that calls for refactoring the
application.

I'm sorry if that wasn't a real help.

cheers
Dierk

> -----Original Message-----
> From: Mendiola R.,DP ITS,SMR,TR,extern
> [mailto:R.Mendiola@deutschepost.de]
> Sent: Donnerstag, 21. März 2002 14:33
> To: 'Dierk.Koenig@canoo.com'
> Subject:
>
>
> Hallo,
>
> also here is an example, the next page will be found internally with the
> seiten_id__ parameter, and the form is activated with javascript.
> These are obviouslly only examples, the real html's are a little more
> complex.
>
> frameset:
>
> <html>
> 	<frameset rows="*,60" frameborder="NO" border="0" framespacing="0">
> 	  <frame name="mainFrame" src="form.jsp">
> 	  <frame name="bottomFrame" scrolling="NO" noresize
> src="buttons.jsp">
> 	</frameset>
> </html>
>
> mainFrame:
> <html>
> 	<script language="JavaScript">
> 	function sendIt(seitenId) {
> 		document.form_a.__seiten_id.value = seitenId;
> 		document.form_a.submit();
> 	}
> 	</script>
> 	<body>
> 		<form name="form_a" method="post" action"proxy">
> 			<input type="hidden" name="seiten_id__"
> value="given_by_sendIt"/>
> 			<input type="radio" name="radio" value="1"/>
> 		</form>
> 	</body>
> </html>
>
> bottomFrame:
> <html>
> 	<body bgcolor="#FFFFFF">
> 	    	<img src="but_save.gif" width="80" height="16" border="0"
> onclick="parent.mainFrame.window.sendIt('PAGE_A')">
>
> 	    	<img src="but_new.gif" width="80" height="16" border="0"
> onclick="parent.mainFrame.window.sendIt('PAGE_B')">
> 	</body>
> </html>
>