Julien,
I have an old version of jwebunit, 1.2. This version does not use HTMLUnuit
but HTTPUnit.
What version have you used, 1.5?
Thanks,
gs
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Julien HENRY
Sent: Thursday, July 31, 2008 12:37 AM
To: Usage problems for JWebUnit
Subject: [JWebUnit-users] Re : form onsubmit is not executed by jwebunit
Works for me (TM)
form.html :
<html>
<head>
<script type="text/javascript">
function changeQuickSearchAction(theForm) {
theForm.action ="ok.html";
}
</script>
</head>
<body>
<form name="crudForm" method="get" action="ko.html"
onsubmit="changeQuickSearchAction(this);return true;">
<input type="submit"/>
</form>
</body>
</html>
ok.html :
<html>
<head>
<title>OK</title>
</head>
<body>
</body>
</html>
AppTest.java :
public class AppTest extends WebTestCase
{
public void testApp()
{
URL url = this.getClass().getResource("/form.html");
beginAt(url.toExternalForm());
submit();
assertTitleEquals("OK");
setScriptingEnabled(false);
beginAt(url.toExternalForm());
submit();
assertTitleEquals("KO");
}
}
----- Message d'origine ----
De : "Saavedra, Gisella" <[EMAIL PROTECTED]>
À : jwebunit-users@lists.sourceforge.net
Envoyé le : Mercredi, 30 Juillet 2008, 23h16mn 12s
Objet : [JWebUnit-users] form onsubmit is not executed by jwebunit
I have the following form
<form name="crudForm" method="post" action="/trips/searchLoads.do"
onsubmit="changeQuickSearchAction(this);return true;">
..
</form>
with the javascript code:
function changeQuickSearchAction(theForm) {
var theSelect = document.getElementById("searchType");
var theSelectValue = theSelect.options[theSelect.selectedIndex].value;
if (theSelectValue == "equipmentId") {
theForm.action ="/trips/searchEquipments.do";
} else {
theForm.action= "/trips/searchLoads.do";
}
}
The script does not seem to be executed.
Any help, I will appreciate it?
gs
________________________________
Envoyé avec Yahoo! Mail
<http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http:/us.rd.yahoo.com/evt=52423/*http:/fr.docs.yahoo.com/mail/overview/index.html>
.
Une boite mail plus intelligente.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users