Package com.meterware.httpunit

Examples of com.meterware.httpunit.HTMLElement


     * @param id HTML element id
     * @param text expected text
     * @throws Exception
     */
    private void checkText(WebResponse resp,String id,String text) throws Exception {
        HTMLElement element = resp.getElementWithID(id);
        assertNotNull(element);
        assertEquals(text,element.getText());
    }
View Full Code Here


     * @param id HTML element id
     * @param text expected start of the text
     * @throws Exception
     */
    private void checkTextStart(WebResponse resp,String id,String text) throws Exception {
        HTMLElement element = resp.getElementWithID(id);
        assertNotNull(element);
        assertTrue(element.getText().startsWith(text));
    }
View Full Code Here

     * @param id HTML element id
     * @param text expected contained text
     * @throws Exception
     */
    private void checkTextContent(WebResponse resp,String id,String text) throws Exception {
        HTMLElement element = resp.getElementWithID(id);
        assertNotNull(element);
        assertTrue(element.getText().indexOf(text) != -1);
    }
View Full Code Here

     * @param id HTML element id
     * @param regex expected regex
     * @throws Exception
     */
    private void checkTextRegex(WebResponse resp,String id,String regex) throws Exception {
        HTMLElement element = resp.getElementWithID(id);
        assertNotNull(element);
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(element.getText());
        assertTrue(matcher.matches());
    }
View Full Code Here

    }

    public void endSimpleRender(WebResponse response)
            throws Exception
    {
        HTMLElement element = response.getElementWithID("testForm:selectBooleanCheckbox1");
        assertNotNull(element);
    }
View Full Code Here

        if (log.isDebugEnabled())
        {
            log.debug(response.getText());
        }

        HTMLElement divtotal = response.getElementWithID("divtotal");
        Assert.assertEquals("7.0", divtotal.getText());

        WebTable[] tables = response.getTables();
        Assert.assertEquals("Wrong number of tables.", 1, tables.length);
        WebTable table = tables[0];
        Assert.assertEquals("Wrong number of rows.", 5, table.getRowCount());
View Full Code Here

        WebTable[] tables = response.getTables();
        Assert.assertEquals("Wrong number of tables.", 1, tables.length);
        Assert.assertEquals("Wrong number of rows.", 2, tables[0].getRowCount());
        Assert.assertEquals("Column content missing?", "ant", tables[0].getCellAsText(1, 0));

        HTMLElement pagination = response.getElementWithID("pagination");
        Assert.assertNotNull("Paging banner not found.", pagination);
        Assert.assertEquals("Pagination links are not as expected.", "1, 2, [3]", pagination.getText());

        Assert.assertEquals(
            "Column 1 should be marked as sorted.",
            "sortable sorted order2",
            tables[0].getTableCell(0, 0).getClassName());
View Full Code Here

        assertEqualsIgnoreOrder(
            "Wrong parameters.",
            new String[]{"sort", "searchid", "dir", pageParameter},
            sortingLink.getParameterNames());

        HTMLElement pagebanner = response.getElementWithID("pagebanner");
        Assert.assertEquals("Wrong page banner", "10|3|4", pagebanner.getText());
        HTMLElement pagelinks = response.getElementWithID("pagelinks");
        Assert.assertEquals("Wrong page links", "1|[2]|3|4|5", pagelinks.getText());

    }
View Full Code Here

        {
            log.debug("RESPONSE: " + response.getText());
        }
        // <span class="pagebanner">3 items found, displaying 1 to 1.</span>

        HTMLElement pagebanner = response.getElementWithID("pagebanner");
        Assert.assertEquals("Wrong page banner", "4|3|4", pagebanner.getText());
    }
View Full Code Here

        if (log.isDebugEnabled())
        {
            log.debug(response.getText());
        }

        HTMLElement pagination = response.getElementWithID("pagination");
        Assert.assertNotNull("Paging banner not found.", pagination);
        Assert.assertEquals("Pagination links are not as expected.", "1, [2]", pagination.getText());

    }
View Full Code Here

TOP

Related Classes of com.meterware.httpunit.HTMLElement

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.