Greetings,
I have the working solution like this:
===
<groovy>
step.context.currentResponse.getElementByName('search').focus()
step.context.currentResponse.getElementByName('search').type('\n')
</groovy>
===
It was for search text input.
Best regards,
Alexey
dy> Huh, I thought 3.0 was the latest, download page is confusing me.
dy> But anyhow, I downloaded and unpacked the latest snapshot's build.zip into
dy> canoo directory. The tests are still failing.
dy> Matter of fact, getHtmlElementById("q").keyDown(13) isn't even being
dy> recognized by canoo groovy script, and this seems to be the most recommended
dy> way of doing simulating "enter". But I'm getting the right hit from
dy> getHtmlElementById("q").isSubmittableByEnter(), so I figure it's locked onto
dy> the right object.
dy> Thanks for the help,
dy> - Dai
dy> Marc Guillemot wrote:
>>
>> Hi Dai,
>>
>> can you please try with latest build. It contains a lot of improvements
>> compared to WebTest-3.0.
>>
>> Cheers,
>> Marc.
>> --
>> Blog: http://mguillem.wordpress.com
>>
>> dave.y wrote:
>>> I'm using webtest 3.0. After the enter press AJAX is suppose to return a
>>> transparent panel with a list of items (it's a search button, and there's
>>> no
>>> url change).
>>>
>>> Is there another method that would be useful in simulating the 'enter' in
>>> webtest then? I've been looking through the htmlunit documentation and
>>> hasn't found any...
>>>
>>> Thanks,
>>>
>>> - Dai
>>>
>>>
>>>
>>> Marc Guillemot wrote:
>>>> Hi,
>>>>
>>>> which WebTest version do you use? What do you expect after the enter
>>>> press?
>>>>
>>>> The <scriptStep language="javascript"> allows you to script WebTest, not
>>>> (directly) to inject JavaScript into the page.
>>>>
>>>> Cheers,
>>>> Marc.
>>>> --
>>>> Blog: http://mguillem.wordpress.com
>>>>
>>>> dave.y wrote:
>>>>> Hi all,
>>>>>
>>>>> I've been trying to simulate an enter press at a website's text input
>>>>> field.
>>>>> But currently none of my attempts or the suggestions I could find seem
>>>>> to
>>>>> work.
>>>>>
>>>>> I've been mostly trying to use the groovy code, for example:
>>>>> <groovy>
>>>>>
>>>>> step.context.currentResponse.getHtmlElementById("q").keyDown(13)
>>>>> </groovy>
>>>>> <groovy>
>>>>>
>>>>> step.context.currentResponse.getHtmlElementById("q").doType("\n".charAt(0),
>>>>> 1==0, 1==0, 1==0)
>>>>> </groovy>
>>>>>
>>>>> So far none of these are returning anything for me. The returns should
>>>>> be
>>>>> in
>>>>> AJAX, but I'm using the easyajax flag with a wait loop, and thus far
>>>>> it's
>>>>> catching the other AJAX returns from the website fine.
>>>>>
>>>>>
>>>>> I've also tried using javascript (like the following). However since
>>>>> Canoo
>>>>> is using the garogoylesoftware.htmlunit package the usual methods
>>>>> aren't
>>>>> working for me.
>>>>> <scriptStep language="javascript">
>>>>> document.getElementById('search_form').submit()
>>>>> </scriptStep>
>>>>>
>>>>> Does anyone have any suggestions on what I'm doing wrong or what else I
>>>>> should try?
>>>>>
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest