[Webtest] Using javascript with canoo Webtest for simulating keyDown

Acc Mera Acc Mera" <acc.mera@gmail.com
Mon, 2 Jul 2007 16:54:53 -0700


Thanks Marc, I too would like to use Groovy and I agree with your
comment on it....
However I am not able to use keyDown(13) :(

What should be the correct usage of this?

<groovy description="Press Return Key" >
	<what should come here?> keyDown(13)
</groovy>

Do I have to add class pathetc to use Groovy with WebTest?
Any links for Groovy with WebTest examples

Thanks so much for your attention,
Acc Mera



On 7/2/07, Marc Guillemot <mguillemot@yahoo.fr> wrote:
> Hi Acc,
>
> which version of WebTest do you use? With which version of htmlUnit?
> It's possible that keyDown doesn't exist in this version (I don't
> remember when it has been added)
>
> Marc.
>
> PS: Groovy is nicer that javascript! ;-)
>
> Acc Mera wrote:
> > Hi Dierk,
> >
> > Thanks for your kind response.
> > item.keyDown(13); is not a functions in the HTML page under test.
> >
> > Any idea why it is not able to find function keyDown?
> > : Error invoking script: org.mozilla.javascript.EcmaError: TypeError:
> > Cannot find function keyDown., Step: Script
> >
> > - Acc Mera
> >
> >
> >
> > On 6/28/07, Dierk Koenig <dierk.koenig@canoo.com> wrote:
> >> from
> >> http://webtest.canoo.com/webtest/manual/scriptStep.html
> >>
> >> "Note: although scriptStep does support JavaScript, at the moment, it
> >> doesn't provide the mechanism to call JavaScript functions in your HTML
> >> pages under test."
> >>
> >> Dierk
> >>
> >> > -----Original Message-----
> >> > From: webtest-admin@lists.canoo.com
> >> > [mailto:webtest-admin@lists.canoo.com]On Behalf Of Acc Mera
> >> > Sent: Donnerstag, 28. Juni 2007 3:25
> >> > To: webtest@lists.canoo.com
> >> > Subject: [Webtest] Using javascript with canoo Webtest for simulating
> >> > keyDown
> >> >
> >> >
> >> > Hi,
> >> >
> >> > I am trying to use <scriptStep language="javascript"> with Canoo to
> >> > simulate keyboard Enter key press, but stuck :(
> >> >
> >> > What is the correct way to do this?
> >> >
> >> > Here is the code used and the error detail:
> >> >
> >> > ....
> >> > <setInputField
> >> >       description="enter text"
> >> >       name="name"
> >> >       value="#{yourname}"/>
> >> >
> >> > <scriptStep language="javascript">
> >> >       item = document.getOneHtmlElementByAttribute('input',
> >> > 'name', 'name');
> >> >       item.keyDown(13);
> >> > </scriptStep>
> >> > ....
> >> >
> >> > This gives error message
> >> > FAIL at com.canoo.webtest.engine.StepExecutionException: Error
> >> > invoking script: org.mozilla.javascript.EcmaError: TypeError: Cannot
> >> > find function keyDown., Step: Script
> >> >
> >> >
> >> > All ideas/suggestions are welcome.
> >> >
> >> > Thanks
> >> > Acc Mera
> >> > _______________________________________________
> >> > WebTest mailing list
> >> > WebTest@lists.canoo.com
> >> > http://lists.canoo.com/mailman/listinfo/webtest
> >>
> >>
> > _______________________________________________
> > WebTest mailing list
> > WebTest@lists.canoo.com
> > http://lists.canoo.com/mailman/listinfo/webtest
> >
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>