Tuesday, April 5, 2011

Watir question regarding select_list and reloading

I have a drop down with multiple options. Whenever you choose an option, the page reloads with data specific with that option. Currently I'm using

select.list(:name, strg).set(value)

and it does that part just fine, but it does not reload the page with the specific data. Anyone know how to help. When i watch it in action, it doesn't select the option either, but my logs show that it does.Thanks.

Edit: Got it to work with fire_event("onclick")

From stackoverflow
  • ie.select_list(:name, strg).set

    If that doesn't work, can you post an html snippet?

  • Without seeing the page, my guess is that you have to fire JavaScript event. Something like:

    select.list(:name, strg).set(value)
    select.list(:name, strg).fire_event "onchange"
    
    AJ : Thanks for the reply, onchange did not work but then i started looking at other fire_event and tried fire_event("onclick") which works.

0 comments:

Post a Comment