Examples of closeAllWindows()


Examples of com.gargoylesoftware.htmlunit.WebClient.closeAllWindows()

  @SecondsLong(43)
  @TestType(Type.INTEGRATION)
  public void testKeepalive() throws Exception {
    WebClient c = new WebClient();
    String requestId = ((HtmlPage) c.getPage(TEST_URL)).getElementById("requestId").getAttribute("value");
    c.closeAllWindows();
    if (c.getPage(TEST_URL_PREFIX + "/keepalive/?requestId=" + requestId).getWebResponse().getContentAsString().startsWith("SUCCESS") == false) {
      throw new Exception("Initial keepalive should be successfull");
    }
    Thread.sleep(43000);
    if (c.getPage(TEST_URL_PREFIX + "/keepalive/?requestId=" + requestId).getWebResponse().getContentAsString().startsWith("FAILURE") == false) {
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.closeAllWindows()

    WebClient c2 = new WebClient();
    String requestId1 = ((HtmlPage) c1.getPage(TEST_URL)).getElementById("requestId").getAttribute("value");
    String requestId2 = ((HtmlPage) c2.getPage(TEST_URL)).getElementById("requestId").getAttribute("value");
    System.out.println("Pages got");
    c1.closeAllWindows();
    c2.closeAllWindows();
    System.out.println("Windows closed");
    if (c1.getPage(TEST_URL_PREFIX + "/pushnotifications/?requestId=" + requestId1).getWebResponse().getContentAsString().startsWith("SUCCESS") == false) {
      throw new Exception("There should be a notification!");
    }
    System.out.println("Notifications working");
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.closeAllWindows()

        HtmlCheckBoxInput catalogItems = (HtmlCheckBoxInput) form.getInputByName("items");

        System.out.println(">>>" + catalogItems.getAttribute("value"));
        Assert.assertEquals("Apple - $2.99", catalogItems.getAttribute("value"));

        webClient.closeAllWindows();
    }

}
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.closeAllWindows()

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

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

        out.println("");
        out.close();
      } catch (Throwable e) {
        log.severe("Crawl filter encountered an exception.");
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.closeAllWindows()

        stringBuilder.append("You probably want to see this page: <a href=\"" + url + "\">" + url +
                "</a></h3></center>\n");
        stringBuilder.append("<hr />\n");

        stringBuilder.append(page.asXml());
        webClient.closeAllWindows();
        return stringBuilder;
    }

    /**
     * Checks if there is a page from {@code deprecatedPages} that is not expired. If there is
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.closeAllWindows()

            (HtmlAnchor) page.getByXPath( "//a[contains(@href, 'surefire260_TestB_testDup')]" ).get( 0 );
        final HtmlDivision content = (HtmlDivision) page.getElementById( "surefire260_TestB_testDuperror" );
        assertTrue( content.getAttribute( "style" ).contains( "none" ) );
        a.click();
        assertFalse( content.getAttribute( "style" ).contains( "none" ) );
        webClient.closeAllWindows();
    }
}
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.closeAllWindows()

        HtmlCheckBoxInput catalogItems = (HtmlCheckBoxInput) form.getInputByName("items");

        System.out.println(">>>" + catalogItems.getAttribute("value"));
        Assert.assertEquals("Apple - $2.99", catalogItems.getAttribute("value"));

        webClient.closeAllWindows();
    }

}
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.closeAllWindows()

            (HtmlAnchor) page.getByXPath( "//a[contains(@href, 'surefire260_TestB_testDup')]" ).get( 0 );
        final HtmlDivision content = (HtmlDivision) page.getElementById( "surefire260_TestB_testDuperror" );
        assertTrue( content.getAttribute( "style" ).contains( "none" ) );
        a.click();
        assertFalse( content.getAttribute( "style" ).contains( "none" ) );
        webClient.closeAllWindows();
    }
}
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.closeAllWindows()

            e.printStackTrace(); // just to get it in the console in debug phase
            throw e;
        }

        assertMoviesPresent(page);
        webClient.closeAllWindows();
    }

    private void assertMoviesPresent(HtmlPage page) {
        String pageAsText = page.asText();
        assertTrue(pageAsText.contains("Wedding Crashers"));
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.closeAllWindows()

        HtmlCheckBoxInput catalogItems = (HtmlCheckBoxInput) form.getInputByName("items");

        System.out.println(">>>" + catalogItems.getAttribute("value"));
        Assert.assertEquals("Apple - $2.99", catalogItems.getAttribute("value"));

        webClient.closeAllWindows();
    }

}
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.