Elements from dropdown.

6 views
Skip to first unread message

Girish pattana

unread,
Aug 16, 2010, 5:40:25 AM8/16/10
to indian-seleni...@googlegroups.com
Hi All,
         Can anyone  please help me in getting elements from a dropdown box.I had used selenium.getSelectOptions method, its not working for me.

thanks,
-Girish

amaresh ojha

unread,
Aug 16, 2010, 10:33:34 AM8/16/10
to indian-seleni...@googlegroups.com
You can click on the dropdown first and then select the required option.
--Amaresh


--
You received this message because you are subscribed to the Google Groups "Indian Selenium Users Group" group.
To post to this group, send email to indian-seleni...@googlegroups.com.
To unsubscribe from this group, send email to indian-selenium-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/indian-selenium-users-group?hl=en.

Ashok Pannasa

unread,
Aug 16, 2010, 11:38:30 PM8/16/10
to indian-seleni...@googlegroups.com
Hi Girish,

Is it a html drop down box?
If its a drop dow created in YIU or AJAX this function will not work.

Thanks,
Ashok P

thanks,
-Girish


Girish pattana

unread,
Aug 17, 2010, 2:02:05 AM8/17/10
to indian-seleni...@googlegroups.com
Hi Ashok,
              This dropdown is created using Ajax.

thanks,
 -girish

kamalakar vadla

unread,
Aug 17, 2010, 3:39:48 AM8/17/10
to indian-seleni...@googlegroups.com
You have wait for the drop to be loaded (ajax handling ) and then u have to fire getselectOptions command
Then it work .

How you wait for the drop down to loaded :
  • you can use pause command
  • you can wait for the drop element to appears if it coming after the ajax ( i mean this can be decide based on how u r html code is changed after ajax?)

VK
SocialTwist

--
You received this message because you are subscribed to the Google Groups "Indian Selenium Users Group" group.
To post to this group, send email to indian-seleni...@googlegroups.com.
To unsubscribe from this group, send email to indian-selenium-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/indian-selenium-users-group?hl=en.



--
Kamalakar.Vadla
Pramati Technologies Pvt Ltd
Begumpet

Ashok Pannasa

unread,
Aug 17, 2010, 5:12:39 AM8/17/10
to indian-seleni...@googlegroups.com, Ashok Pannasa
In such case, the getSelectOptions wouldnt work.

us will have to getText of each option available

Girish pattana

unread,
Aug 17, 2010, 9:22:33 AM8/17/10
to indian-seleni...@googlegroups.com, Ashok Pannasa


Hi,
    Drop element is'nt showing off for me, when I enter any text, for example if I type "a", in the search field it should display list of countries, when I do manually its showing up for me, but when i do it from selenium, i,e.. when I type any text its not showing dropdown list, since drodown elements are ajax driven..

thanks

kamalakar vadla

unread,
Aug 17, 2010, 9:31:45 AM8/17/10
to indian-seleni...@googlegroups.com
use have to use  typekeys instead of type command 

--VK

--
You received this message because you are subscribed to the Google Groups "Indian Selenium Users Group" group.
To post to this group, send email to indian-seleni...@googlegroups.com.
To unsubscribe from this group, send email to indian-selenium-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/indian-selenium-users-group?hl=en.

Girish pattana

unread,
Aug 18, 2010, 1:32:14 AM8/18/10
to indian-seleni...@googlegroups.com, vkcha...@gmail.com
Hi,

         Thanks Kamalakar, its working fine after using 'TypeKeys' ,its retreiving ajax objects , Thanks a lot ..

Thanks all,
 -Girish

Girish pattana

unread,
Aug 20, 2010, 12:21:56 AM8/20/10
to Ashok Pannasa, indian-seleni...@googlegroups.com

Thanks Ashok..

On Thu, Aug 19, 2010 at 3:23 PM, Ashok Pannasa <ashokh...@gmail.com> wrote:
Hi Girish,

type command place a text in the corresponding field but fire a keyboard event.
The drop down is based on the keyboard event fired.
 So you can do this in 2 ways
1. use typeKeys (fires keyboard event)
2. use type and fireEvent(keyboard).

Use 2 if 1 doesn't work.

Thanks,
Ashok P

Ashok Pannasa

unread,
Aug 19, 2010, 5:53:34 AM8/19/10
to Girish pattana, Ashok Pannasa, indian-seleni...@googlegroups.com
Hi Girish,

type command place a text in the corresponding field but fire a
keyboard event.
The drop down is based on the keyboard event fired.
So you can do this in 2 ways
1. use typeKeys (fires keyboard event)
2. use type and fireEvent(keyboard).

Use 2 if 1 doesn't work.

Thanks,
Ashok P
On Aug 17, 2010, at 6:52 PM, Girish pattana wrote:

Reply all
Reply to author
Forward
0 new messages