Package com.gargoylesoftware.htmlunit

Examples of com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController


  public void setUp() throws Exception {
    webClient = new WebClient();
    // NicelyResynchronizingAjaxController changes XHR calls from asynchronous
    // to synchronous, saving the test from needing to wait or sleep for XHR
    // completion.
    webClient.setAjaxController(new NicelyResynchronizingAjaxController());
    alertHandler = new CollectingAlertHandler();
    webClient.setAlertHandler(alertHandler);
    token = createToken("canonical", "john.doe");
    language = null;
  }
View Full Code Here


        WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3);
        webClient.setRedirectEnabled(true);
        webClient.setThrowExceptionOnScriptError(false);
        //webClient.waitForBackgroundJavaScript(100000);
        //webClient.waitForBackgroundJavaScriptStartingBefore(100000);
        webClient.setAjaxController(new NicelyResynchronizingAjaxController());

        HtmlPage page = (HtmlPage) webClient.getPage("http://localhost:8080/store/store.html");

        HtmlForm form = (HtmlForm) page.getFormByName("catalogForm");
View Full Code Here

  public void setUp() throws Exception {
    webClient = new WebClient();
    // NicelyResynchronizingAjaxController changes XHR calls from asynchronous
    // to synchronous, saving the test from needing to wait or sleep for XHR
    // completion.
    webClient.setAjaxController(new NicelyResynchronizingAjaxController());
    webClient.waitForBackgroundJavaScript(120000)// Closure can take a long time...
    webClient.setHTMLParserListener(HTMLParserListener.LOG_REPORTER);
    webClient.getOptions().setTimeout(120000)// Closure can take a long time...

    alertHandler = new CollectingAlertHandler();
View Full Code Here

    @Test
    @SpecAssertions({ @SpecAssertion(section = CONVERSATION_CONTEXT, id = "l") })
    public void testConversationPropagatedAjax() throws Exception {

        WebClient webClient = new WebClient();
        webClient.setAjaxController(new NicelyResynchronizingAjaxController());

        HtmlPage storm = webClient.getPage(getPath("storm-ajax.jsf"));

        // Begin long-running conversation - note that we use ajax
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class,
View Full Code Here

    @Test
    @SpecAssertions({ @SpecAssertion(section = CONVERSATION_CONTEXT, id = "l") })
    public void testConversationPropagatedAjax() throws Exception {

        WebClient webClient = new WebClient();
        webClient.setAjaxController(new NicelyResynchronizingAjaxController());

        HtmlPage storm = webClient.getPage(getPath("storm-ajax.jsf"));

        // Begin long-running conversation - note that we use ajax
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class,
View Full Code Here

    @Override
    @Before
    public void before() throws Exception
    {
        webClient = new WebClient(getBrowserVersion());
        webClient.setAjaxController(new NicelyResynchronizingAjaxController());
    }
View Full Code Here

    public void before() throws Exception
    {
        super.before();

        webClient = new WebClient(getBrowserVersion());
        webClient.setAjaxController(new NicelyResynchronizingAjaxController());
    }
View Full Code Here

  public void setUp() throws Exception {
    webClient = new WebClient();
    // NicelyResynchronizingAjaxController changes XHR calls from asynchronous
    // to synchronous, saving the test from needing to wait or sleep for XHR
    // completion.
    webClient.setAjaxController(new NicelyResynchronizingAjaxController());
    webClient.waitForBackgroundJavaScript(2000);
    webClient.setHTMLParserListener(HTMLParserListener.LOG_REPORTER);
    webClient.setTimeout(3000);

    alertHandler = new CollectingAlertHandler();
View Full Code Here

        WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3);
        webClient.setRedirectEnabled(true);
        webClient.setThrowExceptionOnScriptError(false);
        //webClient.waitForBackgroundJavaScript(100000);
        //webClient.waitForBackgroundJavaScriptStartingBefore(100000);
        webClient.setAjaxController(new NicelyResynchronizingAjaxController());

        HtmlPage page = (HtmlPage) webClient.getPage("http://localhost:8080/store/store.html");

        HtmlForm form = (HtmlForm) page.getFormByName("catalogForm");
View Full Code Here

        client.setJavaScriptErrorListener(loggingJsErrorListener);
        client.setHTMLParserListener(quietHtmlParserListener);
        client.setCssErrorHandler(quietCssErrorHandler);

        client.getOptions().setJavaScriptEnabled(true);
        client.setAjaxController(new NicelyResynchronizingAjaxController());
        client.getOptions().setThrowExceptionOnScriptError(false);
        client.getOptions().setThrowExceptionOnFailingStatusCode(false);
        client.getOptions().setPrintContentOnFailingStatusCode(false);
        client.setWebConnection(new HttpWebConnection(client) {
            @Override
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController

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.