Javascript problem

Sachin Karisiddappa <[email protected]>
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <[email protected]>
I am getting the following exception whenever I try to execute a 
javascript function from my test case.

 java.lang.IllegalStateException: may not run executeScript() from class 
com.meterware.httpunit.javascript.JavaScript$Form


What is the problem? I have added Rhino (js.jar) to my class path and 
enabled scripting too.

Thanks,
Sachin

html:

<input type="hidden" name="state" value="1">
<input onClick='onCancel()' class='cuesButton' id='1tbl' name='Cancel' alt='Cancel' value='Cancel' type='button'>
<input onClick='onNext()' class='cuesButton' id='2tbl' name='Next' alt='Next' value='Next' type='button'>

function onCancel() {

	document.forms[0].action = "installCancel.do";
	document.forms[0].submit();
}

function onNext() {
	var f = document.forms[0];
	f.action = "installOptions.do";
	f.submit();
}


Testcase:
 public void testScenario() throws Exception {
        HttpUnitOptions.clearScriptErrorMessages();
        wc = new WebConversation();
        WebForm forms[] = _wc.getCurrentPage().getForms();
        forms[0].getScriptableObject().runScript("JavaScript","onNext()");
}

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.