Watir question regarding select_list and reloading

若如初见. 提交于 2019-12-13 12:33:29

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!