Package com.gargoylesoftware.htmlunit.html

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


  }

  @Test
  public void testTemplateLibrary() throws Exception {
    HtmlPage page = executeAllPageTests("templateLibrary");
    String pageXml = page.asXml();
    assertTrue(pageXml.replaceAll("[\n\r ]", "").contains("p{color:red}"));

    Node paragraph = page.getElementsByTagName("p").item(0);
    assertEquals("Hello world", paragraph.getTextContent().trim());
  }
View Full Code Here


  public void testGallery() throws FailingHttpStatusCodeException, MalformedURLException, IOException, InterruptedException {
    final HtmlPage page = webClient.getPage("http://localhost:8080/photark/");
    final HtmlTable table = page.getHtmlElementById("tableGallery");
   
    //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"));
   
View Full Code Here

  public void testGallery() throws FailingHttpStatusCodeException, MalformedURLException, IOException, InterruptedException {
    final HtmlPage page = webClient.getPage("http://localhost:8080/photark/");
    final HtmlTable table = page.getHtmlElementById("tableGallery");
   
    //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"));
   
View Full Code Here

  public void testGallery() throws FailingHttpStatusCodeException, MalformedURLException, IOException, InterruptedException {
    final HtmlPage page = webClient.getPage("http://localhost:8080/photark/");
    final HtmlTable table = page.getHtmlElementById("tableGallery");
   
    //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"));
   
View Full Code Here

  }

  @Test
  public void testTemplateLibrary() throws Exception {
    HtmlPage page = executeAllPageTests("templateLibrary");
    String pageXml = page.asXml();
    assertTrue(pageXml.replaceAll("[\n\r ]", "").contains("p{color:red}"));

    Node paragraph = page.getElementsByTagName("p").item(0);
    assertEquals("Hello world", paragraph.getTextContent().trim());
  }
View Full Code Here

          + pageName + "\">" + pageName + "</a></h3></center>");
      out.println("<hr>");

      webClient.waitForBackgroundJavaScriptStartingBefore(10000);

      out.println(page.asXml());
      webClient.closeAllWindows();
      out.close();

    } else {
     
View Full Code Here

    public void testRender() throws Exception {
        HtmlPage page = renderView();

        assertNotNull(page);
        System.out.println(page.asXml());

        try {
            HtmlElement empty = page.getHtmlElementById(panel1.getClientId(facesContext));

            assertFalse("ElementNotFoundException was not thrown", true);
View Full Code Here

    public void testRender() throws Exception {
        HtmlPage page = renderView();

        assertNotNull(page);
        System.out.println(page.asXml());

        try {
            HtmlElement empty = page.getHtmlElementById(include1.getClientId(facesContext));

            assertFalse("ElementNotFoundException was not thrown", true);
View Full Code Here

    public void testRendered() throws Exception {
        HtmlPage page = renderView();

        assertNotNull(page);
        System.out.println(page.asXml());

        HtmlElement href = page.getHtmlElementById(link1.getClientId(facesContext));

        assertNotNull(href);
        assertEquals("a", href.getTagName());
View Full Code Here

    public void testRender() throws Exception {
        HtmlPage page = renderView();

        assertNotNull(page);
        System.out.println(page.asXml());

        HtmlElement html = (HtmlElement) page.getFirstChild();

        assertNotNull(html);
        assertEquals("html", html.getTagName());
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.