HtmlUnitTestingEngineImpl.getSubmitButton() fails with Ajax
Brought to you by:
henryju
If page opens dialog form (e.g. confirm window) with Ajax, HtmlUnitTestingEngineImpl.getSubmitButton(buttonName) does not find the submit button.
I don't exactly know what current form member field means here, but if I set it to null in debugger, the requested button is found after getCurrentPage.getForms().
So the method should first check, if button is found in current form, and then if it is found in other forms on the page.
getTextFieldValue(paramName) works this way, for example.
I guess the workaround would be using setWorkingForm().
Same applies to private methods getCheckBox(), possible some others too.
Currently I am setting the current form field to null via reflection, as page contains so many different forms, that it is painful to maintain the index, and null can not be set directly or with non-existing index in setWorkingForm().