Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.DomNode


        }

        public Doj next() {
            List<HtmlElement> siblings = new ArrayList<HtmlElement>();
            for (HtmlElement element : contextElements) {
                DomNode node = element.getNextSibling();
                while (node != null && node.getNodeType() != Node.ELEMENT_NODE) {
                    node = node.getNextSibling();
                }
                if (node != null) {
                    siblings.add((HtmlElement) node);
                }
            }
View Full Code Here


        }

        public Doj next(String tag) {
            List<HtmlElement> siblings = new ArrayList<HtmlElement>();
            for (HtmlElement element : contextElements) {
                DomNode node = element.getNextSibling();
                while (node != null && (node.getNodeType() != Node.ELEMENT_NODE || !node.getNodeName().equalsIgnoreCase(tag))) {
                    node = node.getNextSibling();
                }
                if (node != null && node.getNodeName().equalsIgnoreCase(tag)) {
                    siblings.add((HtmlElement) node);
                }
            }
            return on(siblings);
        }
View Full Code Here

        }

        public Doj previous() {
            List<HtmlElement> siblings = new ArrayList<HtmlElement>();
            for (HtmlElement element : contextElements) {
                DomNode node = element.getPreviousSibling();
                while (node != null && node.getNodeType() != Node.ELEMENT_NODE) {
                    node = node.getPreviousSibling();
                }
                if (node != null) {
                    siblings.add((HtmlElement) node);
                }
            }
View Full Code Here

        }

        public Doj previous(String tag) {
            List<HtmlElement> siblings = new ArrayList<HtmlElement>();
            for (HtmlElement element : contextElements) {
                DomNode node = element.getPreviousSibling();
                while (node != null && (node.getNodeType() != Node.ELEMENT_NODE || !node.getNodeName().equalsIgnoreCase(tag))) {
                    node = node.getPreviousSibling();
                }
                if (node != null && node.getNodeName().equalsIgnoreCase(tag)) {
                    siblings.add((HtmlElement) node);
                }
            }
            return on(siblings);
        }
View Full Code Here

        assertEquals("rf-ds-btn rf-ds-btn-prev", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
    }

    private String getCurrentPageContent(HtmlPage page, int i) throws Exception {
        HtmlElement content = page.getFirstByXPath("//*[@id = 'form:richTable:" + (--i) + ":pageContent']");
        DomNode text = content.getFirstChild();
        assertEquals(DomNode.TEXT_NODE, text.getNodeType());
        return text.getNodeValue();
    }
View Full Code Here

    HtmlPage page = executePageTest("failCajaTest", null);
    NodeList bodyList = page.getElementsByTagName("body");
   
    // Result should contain just one body
    assertEquals(1, bodyList.getLength());
    DomNode body = (DomNode) bodyList.item(0);

    // Failed output contains only an error block plus a onload script block
    assertEquals(2, body.getChildNodes().getLength());
    assertEquals("ul", body.getFirstChild().getNodeName());
    assertEquals("script", body.getLastChild().getNodeName());
  }
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.html.DomNode

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.