Select a value from a combobox with funcunit

257 views
Skip to first unread message

mada

unread,
Sep 16, 2010, 10:09:24 AM9/16/10
to FuncUnit
How can I select a certain value from a combobox with funcunit? I
tried using the type() function, but didn't work.
Any help is appreciated. Thanks.

Justin Meyer

unread,
Sep 16, 2010, 10:15:28 AM9/16/10
to func...@googlegroups.com
click on th e <option>

Justin Meyer

Jupiter Consulting
\Development\Training\Support
847-924-6039
justin...@gmail.com

Alexandre Gomes

unread,
Sep 16, 2010, 10:17:10 AM9/16/10
to func...@googlegroups.com
Try something like this:

test("Test clicking item 2 and check it was selected.", function() {
S("#combobox").click(); // open the combobox
S(".item_2").visible(); // wait until item 2 is visible
S(".item_2").click(function(){
// check  item #2 was selected
ok(/<item_2_text>/.test(S("#combobox input[type=text]").val()), "Item #2 was selected.");
});
});

On Thu, Sep 16, 2010 at 9:09 AM, mada <bidilita...@gmail.com> wrote:

mada

unread,
Sep 16, 2010, 10:25:25 AM9/16/10
to FuncUnit
Thanks :), your solution worked perfectly.

On Sep 16, 5:17 pm, Alexandre Gomes <alexandre.r...@gmail.com> wrote:
> Try something like this:
>
> test("Test clicking item 2 and check it was selected.", function() {
> S("#combobox").click(); // open the combobox
>  S(".item_2").visible(); // wait until item 2 is visible
>  S(".item_2").click(function(){
> // check  item #2 was selected
> ok(/<item_2_text>/.test(S("#combobox input[type=text]").val()), "Item #2 was
> selected.");
>
> });
> });
Reply all
Reply to author
Forward
0 new messages