Christophe Blin - 2005-04-13

I try to write a test to submit a form with a FCK editor field in it (with Jameleon HttpUnit plugin):
<form name="my_form" action="index.php">
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'cf_cont','600px','400' ) ;
oFCKeditor.ToolbarSet = "ToolBarTable" ;
oFCKeditor.Value="&nbsp;";
oFCKeditor.Create();
</script>
<input class="SubmitButton" name="valid" type="submit" value="Validez" tabindex="11">
</form>

Now the test:
public class AddTexte extends HttpUnitFunctionTag{
/**
* Text content
* @jameleon.attribute required="false" contextName="content"
*/
public String cont;
/**
* The name of the form to submit
* @jameleon.attribute required="true" default="my_form" contextName="formName"
*/
public String textForm;

public void testBlock(){
WebForm form = getForm(textForm);
form.setParameter("cf_cont", cont); 
submitForm(form);
}
}

then I get the exception "No parameter named 'cf_cont' is defined in the form"

But this parameter is defined via the ctor of FCKEditor. I'm stucked with this problem for a day now and I start believe I should take another test framework (like MaxQ for example which simply do post and get)

Precision:
using form.getScriptableObject().setParameterValue("cf_cont", cont);

gives the exception java.lang.ArrayIndexOutOfBoundsException: 0

I do not know why...

Any help appreciated