/** * @param form * @return */ public static HtmlSubmitInput getSubmitInput(final HtmlForm form) { final List<HtmlElement> inputs = form.getHtmlElementsByTagName(HtmlInput.TAG_NAME); for (final HtmlElement element : inputs) { final HtmlInput input = (HtmlInput) element; if ("submit".equalsIgnoreCase(input.getTypeAttribute())) { return (HtmlSubmitInput) input; } } return null; }
private ClaimBuildAction applyClaimWithFailureCauseSelected( String element, String error, String reason, String description) throws Exception { HtmlPage page = whenNavigatingtoClaimPage(); page.getElementById(element).click(); HtmlForm form = page.getFormByName("claim"); form.getTextAreaByName("reason").setText(reason); HtmlSelect select = form.getSelectByName("_.errors"); HtmlOption option = select.getOptionByValue(error); select.setSelectedAttribute(option, true); assertEquals(description, form.getTextAreaByName("errordesc").getTextContent()); form.submit((HtmlButton) j.last(form.getHtmlElementsByTagName("button"))); ClaimBuildAction action = build.getAction(ClaimBuildAction.class); return action; }