Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlBase


    /**
     * <p>Verify the presence and contents of a base element.</p>
     */
    public void testBase() throws Exception {

        HtmlBase base = null;
        Iterator kids = head().getChildIterator();
        while (kids.hasNext()) {
            HtmlElement kid = (HtmlElement) kids.next();
            if (kid instanceof HtmlBase) {
                assertNull("Only one base element present", base);
                base = (HtmlBase) kid;
            }
        }
        assertNotNull("Exactly one base element present", base);
        assertEquals("base", base.getTagName());
        assertEquals(url("/simple.jsp").toString(), base.getHrefAttribute());
        assertEquals("", base.getTargetAttribute());

    }
View Full Code Here


    /**
     * <p>Verify the presence and contents of a base element.</p>
     */
    public void testBase() throws Exception {

        HtmlBase base = null;
        Iterator kids = head().getChildElements().iterator();
        while (kids.hasNext()) {
            HtmlElement kid = (HtmlElement) kids.next();
            if (kid instanceof HtmlBase) {
                assertNull("Only one base element present", base);
                base = (HtmlBase) kid;
            }
        }
        assertNotNull("Exactly one base element present", base);
        assertEquals("base", base.getTagName());
        assertEquals(url("/simple.jsp").toString(), base.getHrefAttribute());
        assertEquals("", base.getTargetAttribute());

    }
View Full Code Here

    /**
     * <p>Verify the presence and contents of a base element.</p>
     */
    public void testBase() throws Exception {

        HtmlBase base = null;
        Iterator kids = head().getChildElements().iterator();
        while (kids.hasNext()) {
            HtmlElement kid = (HtmlElement) kids.next();
            if (kid instanceof HtmlBase) {
                assertNull("Only one base element present", base);
                base = (HtmlBase) kid;
            }
        }
        assertNotNull("Exactly one base element present", base);
        assertEquals("base", base.getTagName());
        assertEquals(url("/simple.jsp").toString(), base.getHrefAttribute());
        assertEquals("", base.getTargetAttribute());

    }
View Full Code Here

        meta = (HtmlMeta) elementIterator.next();
        assertEquals( meta.getAttribute( "name" ), "keywords" );
        assertEquals( meta.getAttribute( "content" ), "HTML,CSS,XML,JavaScript" );

        HtmlBase base = (HtmlBase) elementIterator.next();
        assertEquals( base.getAttribute( "href" ), "http://maven.apache.org/" );
    }
View Full Code Here

TOP

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

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.