Package com.gargoylesoftware.htmlunit

Examples of com.gargoylesoftware.htmlunit.ElementNotFoundException


        for (final HtmlOption option : getOptions()) {
            if (option.getValueAttribute().equals(value)) {
                return option;
            }
        }
        throw new ElementNotFoundException("option", "value", value);
    }
View Full Code Here


        for (final HtmlOption option : getOptions()) {
            if (option.getText().equals(text)) {
                return option;
            }
        }
        throw new ElementNotFoundException("option", "text", text);
    }
View Full Code Here

        final List<E> list = getElementsByAttribute(elementName, attributeName, attributeValue);

        final int listSize = list.size();
        if (listSize == 0) {
            throw new ElementNotFoundException(elementName, attributeName, attributeValue);
        }

        return list.get(0);
    }
View Full Code Here

        for (final HtmlAnchor anchor : getAnchors()) {
            if (text.equals(anchor.asText())) {
                return anchor;
            }
        }
        throw new ElementNotFoundException("a", "<text>", text);
    }
View Full Code Here

     * @exception ElementNotFoundException If no forms match the specified result.
     */
    public HtmlForm getFormByName(final String name) throws ElementNotFoundException {
        final List<HtmlForm> forms = getDocumentElement().getElementsByAttribute("form", "name", name);
        if (forms.size() == 0) {
            throw new ElementNotFoundException("form", "name", name);
        }
        return forms.get(0);
    }
View Full Code Here

            if (frame.getName().equals(name)) {
                return frame;
            }
        }

        throw new ElementNotFoundException("frame or iframe", "name", name);
    }
View Full Code Here

        }
        final List<HtmlElement> elements = idMap_.get(usedID);
        if (elements != null) {
            return (E) elements.get(0);
        }
        throw new ElementNotFoundException("*", "id", id);
    }
View Full Code Here

    public <E extends HtmlElement> E getElementByName(final String name) throws ElementNotFoundException {
        final List<HtmlElement> elements = nameMap_.get(name);
        if (elements != null) {
            return (E) elements.get(0);
        }
        throw new ElementNotFoundException("*", "name", name);
    }
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.