[Webtest] setting values of hidden fields

Darrin Wortlehock webtest@lists.canoo.com
Thu, 11 Jul 2002 05:01:31 +1000 (EST)


Why can't I set the value of a hidden input?

<setinputfield stepid="set hidden useracl field" name="useracl"
value="Whatever"/>
I need to do this to emulate what an onSubmit javascript handler does.

This is what happens:

Error encountered: create
user(com.canoo.webtest.engine.ConfigurableTestCase): Parameter 'useracl'
must have the value ''. Attempted to set it to: { SiteGod }Exception raised:
com.meterware.httpunit.MissingParameterValueException:
Parameter 'useracl' must have the value ''. Attempted to set it to: {
SiteGod }com.meterware.httpunit.MissingParameterValueException: Parameter
'useracl' must have the value ''. Attempted to set it to: { SiteGod }     
  at        com.meterware.httpunit.FormControl.claimValueIsRequired(FormControl.java:193)               at
        com.meterware.httpunit.TextFormControl.claimValueIsRequired(FormControl.java:525)               at
        com.meterware.httpunit.HiddenFieldFormControl.claimRequiredValues(FormControl.java:545)               at
               com.meterware.httpunit.FormParameter.setValues(WebForm.java:561)        at com.meterware.httpunit.WebForm.setParameter(WebForm.java:387)
        at
        com.meterware.httpunit.WebRequest.setParameter(WebRequest.java:116)
               at        com.canoo.webtest.steps.ClickButton.addParameterToRequest(ClickButton.java:142)               at
        com.canoo.webtest.steps.ClickButton.setParameters(ClickButton.java:105)          at
          com.canoo.webtest.steps.ClickButton.doExecute(ClickButton.java:85)        at
        com.canoo.webtest.steps.AbstractTestStepSpecification.execute(AbstractTestStepSpecification.java:57)               at
        com.canoo.webtest.engine.ConfigurableTestCase.runTest(ConfigurableTestCase.java:34)               at junit.framework.TestCase.runBare(TestCase.java:140)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:131)
        at junit.framework.TestCase.run(TestCase.java:124)
        at
        com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask.java:56)               at
        org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:104)
        at org.apache.tools.ant.Task.perform(Task.java:217)
        at org.apache.tools.ant.Target.execute(Target.java:184)
        at org.apache.tools.ant.Target.performTasks(Target.java:202)
        at org.apache.tools.ant.Project.executeTarget(Project.java:601)
        at org.apache.tools.ant.Project.executeTargets(Project.java:560)
        at
        org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:277)              at
        org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:119)BUILD        FAILED
Total time: 2 seconds

Any ideas?

Thanks,

Darrin.