How to deal with Jquery select 2

234 views
Skip to first unread message

Krishantha Samaraweera

unread,
Dec 2, 2013, 2:28:37 PM12/2/13
to robotframe...@googlegroups.com
Hi all,

I'm trying to select values from select2 search box. However selecting values from hidden drop-down didn't work from me using selenium2Library keywords.

Is there any particular way to deal with select2 boxes? Anybody tried out the same. Any help world be really appreciated.

You can refer Example section at  http://ivaynberg.github.io/select2/ to get an idea of select2 search box.

Thanks in advance.

-Krishantha Samaraweera

Krishantha Samaraweera

unread,
Dec 3, 2013, 1:23:15 AM12/3/13
to robotframe...@googlegroups.com
Found a solution. However I'm not quite sure whether there is any better way to do the same. Please provide your feedback.

Test Select2
    Open Browser    http://ivaynberg.github.io/select2/    firefox
    Wait Until Page Contains Element    xpath=/html/body/div[2]/section[3]/article/div/p[3]
    Click Element    id=s2id_e1
    Element Should Be Visible    id=select2-drop
    Input Text    xpath=/html/body/div[4]/div/input    Hawaii
    Click Element    xpath=//li/ul/li/div

Thanks,
Krishantha.
Reply all
Reply to author
Forward
0 new messages