[wtr-general] Radcombox automation

5 views
Skip to first unread message

khaja shaik

unread,
May 25, 2010, 6:36:51 AM5/25/10
to watir-...@googlegroups.com
Hi all,

I am trying to select the value from drop down list of Rad combo box with watir. Is there any solution for this


Thanks,
Khaja shariff

--
Before posting, please read http://watir.com/support. In short: search before you ask, be nice.
 
You received this message because you are subscribed to http://groups.google.com/group/watir-general
To post: watir-...@googlegroups.com
To unsubscribe: watir-genera...@googlegroups.com

Željko Filipin

unread,
May 25, 2010, 6:38:45 AM5/25/10
to watir-...@googlegroups.com
On Tue, May 25, 2010 at 12:36 PM, khaja shaik <khaja...@gmail.com> wrote:
> I am trying to select the value from drop down list of Rad combo box with watir. Is there any solution for this

Sure:

http://wiki.openqa.org/display/WTR/Selection+Boxes

Željko
--
watir.com - community manager
watirpodcast.com - host
testingpodcast.com - audio podcasts on software testing. all of them
vidipodkast.com - pričamo o hardveru, softveru i časopisu Vidi

khaja shaik

unread,
May 25, 2010, 7:11:11 AM5/25/10
to watir-...@googlegroups.com
Actually after clicking the drop down arrow in the combo box , values displayed in the separate iframe, thats why i cannot able to automate

check tha attached screen shot



Thanks,
Khaja shariff

Željko Filipin

unread,
May 25, 2010, 7:18:27 AM5/25/10
to watir-...@googlegroups.com
2010/5/25 khaja shaik <khaja...@gmail.com>

> Actually after clicking the drop down arrow in the combo box , values displayed in the separate iframe, thats why i cannot able to automate
> check tha attached screen shot

"Relevant code snippet is worth a thousand screen shots" a wise man would say.

You still did not say what is the problem.

What did you try? Did you try this?

browser.frame(how, what).select_list(how, what).set(something)

Željko

kiran yajamanyam

unread,
May 25, 2010, 7:27:30 AM5/25/10
to watir-...@googlegroups.com
find the attached .rb file which will help you to understand how to deal with select_list. Else give us the screen shot I will try to send you the piece of code
selectbox_test.rb

Chuck van der Linden

unread,
May 25, 2010, 1:13:16 PM5/25/10
to Watir General
I doubt that code sample will help much. That's great for actual
HTML selection list elements, but he's dealing with 'rad' controls
which are javascript driven controls that emulate the normal HTML
selection list, but add other functionality (like a 'prompt' value
that's in the control space to start with, but is not once of the
choices in the list)

For these kind of controls it's all about using either the developer
toolbar, or firebug to identify what elements have been rendered into
the dom (or modified and moved or made visible) by the javascript, and
then 'activate' them using standard methods like click (which fires a
number of events under the covers), or firing the specific events that
the javascript might be looking for, such as 'onMouseOver'

It can get particularly tricky because some of these things use (IMHO)
rather insane practices like popping up little frames with the 'list'
elements in them etc. and that means you have to click them from
within a frame, something you might have no clue to expect just from
looking at portions of the HTML.

On May 25, 4:27 am, kiran yajamanyam <kiranyajaman...@gmail.com>
wrote:
> find the attached .rb file which will help you to understand how to deal
> with select_list. Else give us the screen shot I will try to send you the
> piece of code
>
> On Tue, May 25, 2010 at 4:48 PM, Željko Filipin <
>
>
>
>
>
> zeljko.fili...@wa-research.ch> wrote:
> > 2010/5/25 khaja shaik <khaja.sh...@gmail.com>
>
> > > Actually after clicking the drop down arrow in the combo box , values
> > displayed in the separate iframe, thats why i cannot able to automate
> > > check tha attached screen shot
>
> > "Relevant code snippet is worth a thousand screen shots" a wise man would
> > say.
>
> > You still did not say what is the problem.
>
> > What did you try? Did you try this?
>
> > browser.frame(how, what).select_list(how, what).set(something)
>
> > Željko
>
> >  --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > You received this message because you are subscribed to
> >http://groups.google.com/group/watir-general
> > To post: watir-...@googlegroups.com
> > To unsubscribe: watir-genera...@googlegroups.com<watir-general%2Bunsubscribe@goog­legroups.com>
>
> --
> Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice.
>
> You received this message because you are subscribed tohttp://groups.google.com/group/watir-general
>  selectbox_test.rb
> 8KViewDownload- Hide quoted text -
>
> - Show quoted text -

khaja shaik

unread,
May 26, 2010, 9:40:44 AM5/26/10
to watir-...@googlegroups.com
Hi,
 
Please find the attached screen shot of Rad combo box. i can able to click the drop down list but i could not able to select the value. Please check the screen shot
 
Thanks for replying
 
Khaja

rad combo.JPG

Chuck van der Linden

unread,
May 27, 2010, 4:58:58 AM5/27/10
to Watir General
Have a look at this example http://demos.telerik.com/aspnet-ajax/combobox/examples/default/defaultcs.aspx

pick the combobox for 'product' does that look something like the
control you are trying to manipulate?


When I examine that example and in particular look at the 'cell' that
has "123" in it

What I find is
div class ="RadComboBoxDropDown"
div class="rcbscroll"
listitem (one of many, with identicle attributes (joy)
table (each listitem has one, and they all have the same
attributes)
table cell with text "123" inside

I got that by clicking in the 'choose product' then clicking the
refresh icon in the tool ribbon of the IE developer toolbar, then
clicking the 'select element by click' tool and finally clicking on
the '"123" item in the third row of the list.

So if the contents of the cell are unique, or your know the index (the
nth time it appears) you might be able to select it with just using a
cell element, identified by the text that's inside the cell, and using
the .click method to 'select' that item on the list.

Anyway if that example on the Telerik site is close to what you are
dealing with, then working with it (as an eample) and developing the
code to work on it, should show you the pattern to follow with your
site. If not, if you can find an example on their site that is close,
it gives the rest of us something we can all access to try and find an
elegant method of automating the control.

> > >  selectbox_test.rb
> > > 8KViewDownload- Hide quoted text -
>
> > > - Show quoted text -
>
> > --

> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > You received this message because you are subscribed to
> >http://groups.google.com/group/watir-general
> > To post: watir-...@googlegroups.com
> > To unsubscribe: watir-genera...@googlegroups.com<watir-general%2Bunsubscribe@goog­legroups.com>
>
>
>

>  rad combo.JPG
> 71KViewDownload- Hide quoted text -

khaja shaik

unread,
May 27, 2010, 8:36:31 AM5/27/10
to watir-...@googlegroups.com

Hi All,
 
We got the solution to click Rad combox drop down list and to select the value.
 
 $ie.link(:id,"rcb__Arrow").click # It should be the link that will trigger the div to appear with the items #
$ie.div(:id,"what ").div(:class," what").ul(:class,"what").li(:text,"what").click
 
 
Thanks,
Khaja shariff
Reply all
Reply to author
Forward
0 new messages