@Override protected List<Object> computeElements() { final List<Object> response = super.computeElements(); response.addAll(htmlForm.getLostChildren()); return response; } };
/** * Returns all the {@code <input type="submit">} elements in this form. */ public static List<HtmlElement> getSubmitButtons(final HtmlForm htmlForm) throws ElementNotFoundException { final List<HtmlElement> list = htmlForm.getElementsByAttribute("input", "type", "submit"); // collect inputs from lost children for (final HtmlElement elt : htmlForm.getLostChildren()) { list.add(elt); } return list; }
@Override protected List<Object> computeElements() { final List<Object> response = super.computeElements(); response.addAll(htmlForm.getLostChildren()); return response; } };
@Override protected List<Object> computeElements() { final List<Object> response = super.computeElements(); response.addAll(htmlForm.getLostChildren()); return response; } };
@Override protected List<Object> computeElements() { final List<Object> response = super.computeElements(); response.addAll(htmlForm.getLostChildren()); return response; } };
@Override protected List<Object> computeElements() { final List<Object> response = super.computeElements(); response.addAll(htmlForm.getLostChildren()); return response; } };
@Override protected List<Object> computeElements() { final List<Object> response = super.computeElements(); response.addAll(htmlForm.getLostChildren()); return response; } };
/** * Returns all the <input type="submit"> elements in this form. */ public List<HtmlSubmitInput> getSubmitButtons() throws ElementNotFoundException { final List<HtmlSubmitInput> list = getElementsByAttribute("input", "type", "submit"); // collect inputs from lost children for (final HtmlElement elt : getLostChildren()) { if (elt instanceof HtmlSubmitInput) { list.add((HtmlSubmitInput) elt); } } return list; }
/** * Returns all the <input type="submit"> elements in this form. */ public List<HtmlSubmitInput> getSubmitButtons() throws ElementNotFoundException { final List<HtmlSubmitInput> list = getElementsByAttribute("input", "type", "submit"); // collect inputs from lost children for (final HtmlElement elt : getLostChildren()) { if (elt instanceof HtmlSubmitInput) { list.add((HtmlSubmitInput) elt); } } return list; }
/** * Returns all the inputs in this form with the specified value. * @param value the value to search for * @return all the inputs in this form with the specified value */ public List<HtmlInput> getInputsByValue(final String value) { final List<HtmlInput> results = getFormElementsByAttribute(HtmlInput.TAG_NAME, "value", value); for (final HtmlElement element : getLostChildren()) { if (element instanceof HtmlInput && value.equals(element.getAttributeDirect("value"))) { results.add((HtmlInput) element); } } return results; }
/** * Returns all the inputs in this form with the specified value. * @param value the value to search for * @return all the inputs in this form with the specified value */ public List<HtmlInput> getInputsByValue(final String value) { final List<HtmlInput> results = getFormElementsByAttribute(HtmlInput.TAG_NAME, "value", value); for (final HtmlElement element : getLostChildren()) { if (element instanceof HtmlInput && value.equals(element.getAttributeDirect("value"))) { results.add((HtmlInput) element); } } return results; }
/** * Returns all the inputs in this form with the specified value. * @param value the value to search for * @return all the inputs in this form with the specified value */ public List<HtmlInput> getInputsByValue(final String value) { final List<HtmlInput> results = getElementsByAttribute("input", "value", value); for (final HtmlElement element : getLostChildren()) { if (element instanceof HtmlInput && value.equals(element.getAttribute("value"))) { results.add((HtmlInput) element); } } return results; }
/** * Returns all input elements which are members of this form and have the specified name. * * @param name the input name to search for * @return all input elements which are members of this form and have the specified name */ public List<HtmlInput> getInputsByName(final String name) { final List<HtmlInput> list = getElementsByAttribute("input", "name", name); // collect inputs from lost children for (final HtmlElement elt : getLostChildren()) { if (elt instanceof HtmlInput && name.equals(elt.getAttribute("name"))) { list.add((HtmlInput) elt); } } return list; }
/** * Returns all the {@link HtmlSelect} elements in this form that have the specified name. * * @param name the name to search for * @return all the {@link HtmlSelect} elements in this form that have the specified name */ public List<HtmlSelect> getSelectsByName(final String name) { final List<HtmlSelect> list = getElementsByAttribute("select", "name", name); // collect selects from lost children for (final HtmlElement elt : getLostChildren()) { if (elt instanceof HtmlSelect && name.equals(elt.getAttribute("name"))) { list.add((HtmlSelect) elt); } } return list; }
/** * Returns all the inputs in this form with the specified value. * @param value the value to search for * @return all the inputs in this form with the specified value */ public List<HtmlInput> getInputsByValue(final String value) { final List<HtmlInput> results = getElementsByAttribute("input", "value", value); for (final HtmlElement element : getLostChildren()) { if (element instanceof HtmlInput && value.equals(element.getAttribute("value"))) { results.add((HtmlInput) element); } } return results; }
/** * Returns all input elements which are members of this form and have the specified name. * * @param name the input name to search for * @return all input elements which are members of this form and have the specified name */ public List<HtmlInput> getInputsByName(final String name) { final List<HtmlInput> list = getFormElementsByAttribute(HtmlInput.TAG_NAME, "name", name); // collect inputs from lost children for (final HtmlElement elt : getLostChildren()) { if (elt instanceof HtmlInput && name.equals(elt.getAttributeDirect("name"))) { list.add((HtmlInput) elt); } } return list; }
/** * Returns all the {@link HtmlTextArea} elements in this form that have the specified name. * * @param name the name to search for * @return all the {@link HtmlTextArea} elements in this form that have the specified name */ public List<HtmlTextArea> getTextAreasByName(final String name) { final List<HtmlTextArea> list = getFormElementsByAttribute(HtmlTextArea.TAG_NAME, "name", name); // collect buttons from lost children for (final HtmlElement elt : getLostChildren()) { if (elt instanceof HtmlTextArea && name.equals(elt.getAttributeDirect("name"))) { list.add((HtmlTextArea) elt); } } return list; }
/** * Returns all the {@link HtmlSelect} elements in this form that have the specified name. * * @param name the name to search for * @return all the {@link HtmlSelect} elements in this form that have the specified name */ public List<HtmlSelect> getSelectsByName(final String name) { final List<HtmlSelect> list = getElementsByAttribute("select", "name", name); // collect selects from lost children for (final HtmlElement elt : getLostChildren()) { if (elt instanceof HtmlSelect && name.equals(elt.getAttribute("name"))) { list.add((HtmlSelect) elt); } } return list; }
/** * Returns all the inputs in this form with the specified value. * @param value the value to search for * @return all the inputs in this form with the specified value */ public List<HtmlInput> getInputsByValue(final String value) { final List<HtmlInput> results = getElementsByAttribute("input", "value", value); for (final HtmlElement element : getLostChildren()) { if (element instanceof HtmlInput && value.equals(element.getAttribute("value"))) { results.add((HtmlInput) element); } } return results; }
private List<HtmlElement> findElements(final String name) { final List<HtmlElement> elements = new ArrayList<>(); addElements(name, getHtmlForm().getHtmlElementDescendants(), elements); addElements(name, getHtmlForm().getLostChildren(), elements); // If no form fields are found, IE and Firefox are able to find img elements by ID or name. if (elements.isEmpty()) { for (final DomNode node : getHtmlForm().getChildren()) { if (node instanceof HtmlImage) { final HtmlImage img = (HtmlImage) node; if (name.equals(img.getId()) || name.equals(img.getNameAttribute())) { elements.add(img); } } } } return elements; }