问题
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")
回答1:
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"
回答2:
ie.select_list(:name, strg).set
If that doesn't work, can you post an html snippet?
来源:https://stackoverflow.com/questions/2877367/watir-question-regarding-select-list-and-reloading