Package com.gargoylesoftware.htmlunit

Examples of com.gargoylesoftware.htmlunit.ElementNotFoundException


        final HtmlElement element = (HtmlElement) allHtmlChildElements.next();
          if (element instanceof HtmlTable) {
              return element;
          }
      }
        throw new ElementNotFoundException("*", "*", "*");
    }
View Full Code Here


        for (HtmlAnchor link : links) {
            if (text.equals(link.asText())) {
                return link;
            }
        }
        throw new ElementNotFoundException("a", "text", text);
    }
View Full Code Here

        for (HtmlAnchor link : links) {
            if (title.equals(link.getAttribute("title"))) {
                return link;
            }
        }
        throw new ElementNotFoundException("a", "title", title);
    }
View Full Code Here

            if (radio instanceof HtmlRadioButtonInput
                && value.equals(radio.getValueAttribute())) {
                return (HtmlRadioButtonInput) radio;
            }
        }
        throw new ElementNotFoundException("input[type=radio, name=" + name + "]", "value", value);
    }
View Full Code Here

            final HtmlTableRow row = iterator.next();
            if (row.getAttribute("id").equals(id)) {
                return row;
            }
        }
        throw new ElementNotFoundException("tr", "id", id);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public final <I extends HtmlInput> I getInputByName(final String name) throws ElementNotFoundException {
        final List<HtmlInput> inputs = getInputsByName(name);

        if (inputs.isEmpty()) {
            throw new ElementNotFoundException("input", "name", name);
        }
        return (I) inputs.get(0);
    }
View Full Code Here

     *         element with the specified name
     */
    public HtmlSelect getSelectByName(final String name) throws ElementNotFoundException {
        final List<HtmlSelect> list = getSelectsByName(name);
        if (list.isEmpty()) {
            throw new ElementNotFoundException("select", "name", name);
        }
        return list.get(0);
    }
View Full Code Here

     *         element with the specified name
     */
    public HtmlButton getButtonByName(final String name) throws ElementNotFoundException {
        final List<HtmlButton> list = getButtonsByName(name);
        if (list.isEmpty()) {
            throw new ElementNotFoundException("button", "name", name);
        }
        return list.get(0);
    }
View Full Code Here

     *         element with the specified name
     */
    public HtmlTextArea getTextAreaByName(final String name) throws ElementNotFoundException {
        final List<HtmlTextArea> list = getTextAreasByName(name);
        if (list.isEmpty()) {
            throw new ElementNotFoundException("textarea", "name", name);
        }
        return list.get(0);
    }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    public <I extends HtmlInput> I getInputByValue(final String value) throws ElementNotFoundException {
        final List<HtmlInput> list = getInputsByValue(value);
        if (list.isEmpty()) {
            throw new ElementNotFoundException("input", "value", value);
        }
        return (I) list.get(0);
    }
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.ElementNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.