Package com.gargoylesoftware.htmlunit.html

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


        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doFill");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        // check table headers
        assertTrue(-1 != responseText.indexOf("ID"));
        assertTrue(-1 != responseText.indexOf("Name"));
        //check table values
View Full Code Here


        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doFillAll");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        //check table headers
        assertTrue(-1 != responseText.indexOf("ID"));
        assertTrue(-1 != responseText.indexOf("Name"));
        assertTrue(-1 != responseText.indexOf("Department_ID"));
View Full Code Here

        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doAddDepartment");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        //check new department
        assertTrue(-1 != responseText.indexOf("79"));

        System.out.println("SUCCESS!!!");
View Full Code Here

        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doChangeDepartmentNames");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        //check update departments
        assertTrue(-1 != responseText.indexOf("Dept-"));
        //also, check to not have old departments names (default name)
        assertTrue(-1 == responseText.indexOf("Default Name"));
View Full Code Here

        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doDeleteDepartments");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        //check that al the company 1 departments are gone..
        assertTrue(-1 == responseText.indexOf("73"));
        assertTrue(-1 == responseText.indexOf("74"));
        assertTrue(-1 == responseText.indexOf("75"));
View Full Code Here

            }
        });

        FreeStyleBuild b = buildAndAssertSuccess(p);
        HtmlPage html = createWebClient().getPage(b, "console");
        String text = html.asText();
        System.out.println(text);
        assertTrue(text.contains("<b>&amp;</b>"));
        assertTrue(b.getLog().contains("<b>&amp;</b>"));
    }
View Full Code Here

        // poll now
        t.new Runner().run();

        HtmlPage log = createWebClient().getPage(p, "scmPollLog");
        String text = log.asText();
        assertTrue(text, text.contains("$$$hello from polling"));
    }

    public static class PollingSCM extends SingleFileSCM {
        public PollingSCM() throws UnsupportedEncodingException {
View Full Code Here

  }

  @Test
  public void testPipelining() throws Exception {
    HtmlPage page = executePageTest("pipeliningTest", null);
    JSONArray array = new JSONArray(page.asText());
    assertEquals(3, array.length());
    Map<String, JSONObject> jsonObjects = Maps.newHashMap();
    for (int i = 0; i < array.length(); i++) {
      JSONObject jsonObj = array.getJSONObject(i);
      assertTrue(jsonObj.has("id"));
View Full Code Here

        //testing the static part of the gallery
        final String pageAsXml = page.asXml();
        assertTrue(pageAsXml.contains("<a href=\"javascript:displayGallery()\" onmouseover=\"document.index.src=index_on.src\" onmouseout=\"document.index.src=index_off.src\" onmousedown=\"beforeClick();\">"));
        assertTrue(pageAsXml.contains("<body onload=\"initGallery()\">"));
        final String pageAsText = page.asText();
        assertTrue(pageAsText.contains("Apache PhotArk Gallery"));

        Thread.sleep(3000);
        //testing the dynamic part of the gallery
View Full Code Here

        //testing the static part of the gallery
        final String pageAsXml = page.asXml();
        assertTrue(pageAsXml.contains("<a href=\"javascript:displayGallery()\" onmouseover=\"document.index.src=index_on.src\" onmouseout=\"document.index.src=index_off.src\" onmousedown=\"beforeClick();\">"));
        assertTrue(pageAsXml.contains("<body onload=\"initGallery()\">"));
        final String pageAsText = page.asText();
        assertTrue(pageAsText.contains("Apache PhotArk Gallery"));

        Thread.sleep(3000);
        //testing the dynamic part of the gallery
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.