How to clear a textbox using FuncUnit?

192 views
Skip to first unread message

Peroli Sivaprakasam

unread,
Aug 11, 2010, 6:03:03 AM8/11/10
to FuncUnit
Hi,
How to clear a textbox using FuncUnit? I have the following code:

HTML:
<input type="text" id="search" />
<input type="submit" value="Go" id="go" />

FuncUnit Test:
// Type "funcunit" in search box and hit "Go"
S('#search').type("funcunit", function(){
S('#go').click(function(){
//Assertions on the search result.
});
});
// Clear the search box and hit "Go"
S('#search').type("", function(){
S('#go').click(function(){
//Assertions on the search result.
});
});

The second one (clearing the text field with type("") doesn't
work.
Is there any other way, apart from doing type("\b\b\b\b\b\b\b\b")
many times?
I tried to use val(), like we use in jQuery, but I get the
following in test result.

waiting for val on #search_dialog_query !==

Thanks,
Peroli Sivaprakasam

Justin Meyer

unread,
Aug 11, 2010, 11:08:11 AM8/11/10
to func...@googlegroups.com
You can do

[ctrl]a\b

Sent from my iPhone

Peroli Sivaprakasam

unread,
Aug 12, 2010, 12:37:57 PM8/12/10
to FuncUnit
Thanks, Justin.

mada

unread,
Sep 27, 2010, 7:28:42 AM9/27/10
to FuncUnit
Why [ctrl]a\b or [ctrl]a[delete] doesn't work in firefox?

Justin Meyer

unread,
Sep 27, 2010, 10:14:09 AM9/27/10
to func...@googlegroups.com
> [ctrl]a[ctrl-up]\b

Works for me. Are you using the download or pulling from git?

Sent from my iPhone

mada

unread,
Oct 7, 2010, 4:10:00 AM10/7/10
to FuncUnit
I am using the downloaded version.
I tried adding '[ctrl-up]' as you suggested and it worked.

Thanks.

On Sep 27, 5:14 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> > [ctrl]a[ctrl-up]\b
>
> Works for me. Are you using the download or pulling from git?
>
> Sent from my iPhone
>
Reply all
Reply to author
Forward
0 new messages