HtmlUnit onchange Java event not fired

I am using HtmlUnit to fill out a form. I have a choice SELECT_A. After selecting the option, additional elements should appear on the page. But it does not work! I am modeling Firefox 3.6.

What do you think?

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

+3
source share
2 answers

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

+5
source

You can use the method fireevent("EventName")and pass the name of the event as a paragraph:

HtmlSelect fromselect = form.getSelectByName("droplist");
fromselect.fireEvent("onchange");
+3
source

All Articles