Examples of asText()


Examples of com.gargoylesoftware.htmlunit.html.HtmlPreformattedText.asText()

        div = (HtmlDivision) elementIterator.next();
        assertEquals( div.getAttribute( "class" ), "source" );

        HtmlPreformattedText pre = (HtmlPreformattedText) elementIterator.next();
        assertEquals( pre.asText().trim(), "<source>1.5</source>" );

        p = (HtmlParagraph) elementIterator.next();
        assertEquals( p.getAttribute( "align" ), "right" );

        a = (HtmlAnchor) elementIterator.next();
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlScript.asText()

        assertEquals( p.asText().trim(), "You should see a JavaScript alert..." );

        HtmlScript script = (HtmlScript) elementIterator.next();
        assertNotNull( script  );
        assertEquals( script.getAttribute( "type" ), "text/javascript" );
        assertEquals( script.asText().trim(), "" );
        final List<String> expectedAlerts = Collections.singletonList( "Hello!" );
        assertEquals( expectedAlerts, collectedAlerts );
    }
}
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSelect.asText()

        final HtmlPage page = webClient.getPage("http://localhost:8080/photark/admin/upload.html");
        Thread.sleep(3000);

        //testing the loaded page
        HtmlSelect select = page.getHtmlElementById("selectAlbum");
        assertTrue(select.asText().contains("New Album"));
        assertTrue(page.<HtmlElement>getHtmlElementById("cancelBtnAlbumDesc").getAttribute("style").contains("display: none;"));
        assertTrue(page.<HtmlElement>getHtmlElementById("deleteAlbum").getAttribute("style").contains("display: none;"));
        assertTrue(page.<HtmlElement>getHtmlElementById("btnAlbumDesc").getAttribute("style").contains("display: none;"));

        assertFalse(page.<HtmlElement>getHtmlElementById("albumCover").asXml().contains("photark/gallery/boston/dsc00376.jpg"));
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan.asText()

        assertEquals("Subview Processing (Page 1 of 2)", title());

        // Verify contents of the first page
        span = (HtmlSpan) element("form:subview_alpha:alpha");
        assertNotNull(span);
        assertEquals("This is the alpha dynamic include", span.asText());

        span = (HtmlSpan) element("form:subview_beta:beta");
        assertNotNull(span);
        assertEquals("This is the beta dynamic include", span.asText());
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.asText()

    public void testButtonWithBinding() throws Exception {
  HtmlPage page = getPage("/faces/jsp/tlvTest01.jsp");
  List list = getAllElementsOfGivenClass(page, null,
                 HtmlSubmitInput.class);
  HtmlSubmitInput button = (HtmlSubmitInput) list.get(0);
  assertEquals("button label", button.asText());
    }


}
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlTableCell.asText()

        assertThat(sourceTable.getRow(row).getCell(1).asText(), equalTo(""+coverageCount));
        assertThat(sourceTable.getRow(row).getCell(3).asText(), equalTo(source));

        HtmlTableCell branchCell = sourceTable.getRow(row).getCell(2);
        if (alertLine == null) {
            assertThat(branchCell.asText(), equalTo(" "));
            assertThat(branchCell.getAttribute("class"), equalTo("numeric "+cssClass));
        } else {
            assertThat(branchCell.asText(), equalTo("info"));
            HtmlAnchor anchor = (HtmlAnchor) branchCell.getFirstChild().getFirstChild();
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlTableDataCell.asText()

        HtmlTableDataCell nextTD = null;
        List<?> tds = calendarHeaderElement.getByXPath("table/tbody/tr/td");
        for (Object td : tds) {
            HtmlTableDataCell htdc = (HtmlTableDataCell) td;
            if (">".equals(htdc.asText())) {
                nextTD = htdc;
            }
        }
        assertNotNull(nextTD);
        HtmlElement div = (HtmlElement) nextTD.getChildElements().iterator().next();
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlTableRow.asText()

        });
        HtmlTable table = taskOverviewPage.getFirstByXPath("//table");
        assertNotNull("Table on Overviewpage not found", table);
        assertEquals("Not all tasks found on page", 4, table.getRowCount());
        HtmlTableRow headerRow = table.getRow(0);
        assertTrue(headerRow.asText().contains("TaskId"));
        HtmlTableRow actionsRow = table.getRow(1);
        assertTrue(actionsRow.asText().contains("filter clear"));
        HtmlTableRow taskOneRow = table.getRow(2);
        assertTrue(taskOneRow.asText().contains("step1"));
        assertEquals("even", taskOneRow.getAttribute("class"));
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlTeletype.asText()

        assertEquals( "b", bold.getTagName() );
        assertEquals( "bold", bold.asText().trim() );

        HtmlTeletype tt = (HtmlTeletype) elementIterator.next();
        assertEquals( "tt", tt.getTagName() );
        assertEquals( "mono", tt.asText().trim() );

        div = (HtmlDivision) elementIterator.next();
        assertEquals( "section", div.getAttribute( "class" ) );

        HtmlHeading3 h3 = (HtmlHeading3) elementIterator.next();
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlTextInput.asText()

        form = getFormById(page, "form");
        input = (HtmlTextInput)
            form.getInputByName("form" + NamingContainer.SEPARATOR_CHAR +
                                "buttonStatus");
        assertTrue("Input does not have expected value",
                   -1 != input.asText().indexOf("button1 was pressed"));
        link = (HtmlAnchor) page.getAnchors().get(0);

        // press button2
        page = (HtmlPage) link.click();
        assertNotNull(page);
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.