开发者

Java HtmlUnit onchange event not fired

开发者 https://www.devze.com 2023-02-17 08:49 出处:网络
I use HtmlUnit to fill form. I have a select SELECT_A. After selecting option the additional elements must appe开发者_如何学Pythonar in the page. But it\'s not working! I simulate Firefox 3.6.

I use HtmlUnit to fill form. I have a select SELECT_A. After selecting option the additional elements must appe开发者_如何学Pythonar in the page. But it's not working! I simulate Firefox 3.6.

What do you think?

I tried to use NicelyResynchronizingAjaxController() but it does not help.


One note: fireEvent should be called with "change" parameter, not "onchange". Or fireEvent(Event.TYPE_CHANGE); is even better.


You can use the method fireevent("EventName") and pass eventname as a paramenter:

HtmlSelect fromselect = form.getSelectByName("droplist");
fromselect.fireEvent("onchange");
0

精彩评论

暂无评论...
验证码 换一张
取 消