I have a select field, that acts both as auto-complete and select box, i'm
not able to set value in that field using watir script. The HTML code for
that select field is below,

<input class="dojoComboBox" type="text"
dojoattachpoint="textInputNode" dojoattachevent="key:_handleKeyEvents;
keyUp: onKeyUp; compositionEnd; onResize;" autocomplete="off" style=""/>
<img class="dojoComboBox" hspace="0" vspace="0"
src="/eglcms/struts/dojo/src/widget/templates/images/combo_box_arrow.png"
dojoattachevent="onMouseUp:
handleArrowClick; onResize;" dojoattachpoint="downArrowNode" style="width:
14px; height: 14px;"/>
and when i type in something (say letter "T"), i should be able to select
from the list that appears like this

<span class="dojoComboBoxOptions" style="position: absolute; width: 140px;
height: 32px; z-index: 1001; left: 325px; top: 702px; opacity: 0; display:
none;">  <div class="dojoComboBoxItem dojoComboBoxItemEven" resultname="T
MATHI" resultvalue="3">
 <b class="">T MATHI</b>
</div>
 <div class="dojoComboBoxItem dojoComboBoxItemOdd" resultname="T BABU"
resultvalue="22">T BABU</div>
</span>

If i have to select the first or the second option, How should i be doing it
in watir?

I have tried firing the events, but the list doesn't appear. I have the
watir script code below:

browser2.text_field(:class,"dojoComboBox").focus()
browser2.text_field(:class,"dojoComboBox").set "T"
browser2.text_field(:class,"dojoComboBox").fire_event('onblur')
Watir::Waiter.wait_until
{browser2.span(:class,"dojoComboBoxOptions").div(:text,/t mathi/).exists?}
browser2.div(:class,"formmainbox").span(:class,"dojoComboBoxOptions").div(:text,/t
mathi/).click

I get an error at the wait until where the operation times out.
I have tried the script using Watir 1.6.2, Ruby 1.8.26 using both Firefox
3.0 and IE 7.0

Any solution would be helpful.

Regards,
Hema

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to