Selenium onChange not working

人盡茶涼 提交于 2019-11-29 06:24:56
kizzx2

I encountered exactly this problem, but in IE only (Firefox and Google Chrome works fine for me)

I found the solution to be manually forcing the update using JavaScript through Selenium's runScript. Some ways to do that can be found here:

How do I programmatically force an onchange event on an input?

For example, if I have jQuery in my Web page, I would do this:

$this->select('IDOfSelectElement', '*some label*');
$this->runScript("$('#IDOfSelectElement').trigger('change')");

tried this?

$this->fireEvent("opps_ondemand", "onchange");

fireEvent(element_id, event_to_trigger);

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