Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage.selectNodes()


        // now select back what's already loaded, to cause the existing elements to be displayed
        s.setSelectedAttribute(opts.get(0),true);

        // make sure that the inner control is still hidden
        List<HtmlInput> textboxes = p.selectNodes("//INPUT[@name='_.textbox2']");
        assertEquals(2,textboxes.size());
        for (HtmlInput e : textboxes)
            assertTrue(!e.isDisplayed());

        // reveal the text box
View Full Code Here


        assertEquals(2,textboxes.size());
        for (HtmlInput e : textboxes)
            assertTrue(!e.isDisplayed());

        // reveal the text box
        List<HtmlInput> checkboxes = p.selectNodes("//INPUT[@name='inner']");
        assertEquals(2,checkboxes.size());
        checkboxes.get(0).click();
        assertTrue(textboxes.get(0).isDisplayed());
        textboxes.get(0).type("Budweiser");
View Full Code Here

        check(createMatrixProject());
    }

    private void check(Item p) throws IOException, SAXException {
        HtmlPage page = new WebClient().getPage(p, "configure");
        List<HtmlSelect> selects = page.selectNodes("//select");
        assertTrue(selects.size()>0);
        for (HtmlSelect select : selects) {
            Set<String> title = new HashSet<String>();
            for(HtmlOption o : select.getOptions()) {
                assertTrue("Duplicate entry: "+o.getText(),title.add(o.getText()));
View Full Code Here

        FreeStyleBuild b = buildAndAssertSuccess(p);

        // make sure we see the annotation
        HtmlPage rsp = createWebClient().getPage(b, "console");
        assertEquals(1,rsp.selectNodes("//B[@class='demo']").size());

        // make sure raw console output doesn't include the garbage
        TextPage raw = (TextPage)createWebClient().goTo(b.getUrl()+"consoleText","text/plain");
        System.out.println(raw.getContent());
        String nl = System.getProperty("line.separator");
View Full Code Here

        FreeStyleBuild b = buildAndAssertSuccess(p);

        // make sure we see the annotation
        HtmlPage rsp = createWebClient().getPage(b, "console");
        assertEquals(1,rsp.selectNodes("//A[@href='http://infradna.com/']").size());

        // make sure raw console output doesn't include the garbage
        TextPage raw = (TextPage)createWebClient().goTo(b.getUrl()+"consoleText","text/plain");
        System.out.println(raw.getContent());
        assertTrue(raw.getContent().contains("\nabc\ndef\n"));
View Full Code Here

    /**
     * Makes sure every link works.
     */
    public void testLinks() throws Exception {
        HtmlPage page = new WebClient().goTo("manage");
        List<?> anchors = page.selectNodes("id('management-links')//*[@class='link']/a");
        assertTrue(anchors.size()>=8);
        for(HtmlAnchor e : (List<HtmlAnchor>) anchors) {
            if(e.getHrefAttribute().endsWith("reload"))
                continue;   // can't really click this
            e.click();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.