On Oct 19, 1:08 pm, RJ <[email protected]> wrote:
> Another IE select issue (on XP-IE8):
>
> HTML:
> <select title="Selection Display" id="selection_display_option">
>   <option value="opt1">opt1</option>
>   <option value="opt2">opt2</option>
>   <option selected="selected" value="opt3">opt3</option>
> </select>
>
> CODE on IRB:  (this works)
> irb(main):056:0> option_selected = "opt1"
> irb(main):057:0>
> browser.select(:id=>"selection_display_option").select(option_selected)
> irb(main):059:0>
> browser.select(:id=>"selection_display_option").send_keys("\xEE
> \x80\x87")
> => ["\356\200\207"]
> irb(main):060:0> #assert <some_code_to_verify>
> => nil
>
> RUBY CODE:
>   def display_new_result option_selected
>
> browser.select(:id=>"selection_display_option").select(option_selected)
>     if browser.driver.browser == :internet_explorer
>       sleep 10
>       browser.select(:id=>"selection_display_option").send_keys("\xEE
> \x80\x87")
>       sleep 10
>     end
>     assert <some_code_to_verify>
>   end
>
> But when ran as a script...getting a generic assert error due to the
> page not loading correctly.
> I tried the usual .click , fire_event(see below) , and my last attempt
> above was to hit enter key above.
>
> I also 
> triedhttp://stackoverflow.com/questions/3787555/how-to-find-out-which-java...
> calling a fire_event("onclick") and fire_event("click")
>   mousedown clientX=320, clientY=108
>   mouseup clientX=320, clientY=108
>   click clientX=212, clientY=-9
>   mouseout clientX=320, clientY=108

The HTML looks like a normal select_list with nothing fancy.  However
if changing the selection causes something to happen, then about the
only thing I can think of is that perhaps there is something we can't
see looking for the selection to change..  You could try firing the
'onchange' event after you change the selection, see if that works.

Generally however if it works from IRB, it should work from a script
unless there's some timing issue, and even then you have 10 second
sleeps in there, which normally would be way more than enough to allow
client side code to do its thing.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to