Package com.gargoylesoftware.htmlunit

Examples of com.gargoylesoftware.htmlunit.CollectingAlertHandler


  @Test
  public void testAdmin() throws FailingHttpStatusCodeException, MalformedURLException, IOException, InterruptedException {
    //passing credentials
    final List collectedAlerts = new ArrayList();
    webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts));
    ((DefaultCredentialsProvider) webClient.getCredentialsProvider()).addCredentials("admin", "password");

    final HtmlPage page = webClient.getPage("http://localhost:8080/photark/admin/upload.html");
    Thread.sleep(3000);
   
View Full Code Here


  @Test
  public void testAdmin() throws FailingHttpStatusCodeException, MalformedURLException, IOException, InterruptedException {
    //passing credentials
    final List collectedAlerts = new ArrayList();
    webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts));
    ((DefaultCredentialsProvider) webClient.getCredentialsProvider()).addCredentials("admin", "password");

    final HtmlPage page = webClient.getPage("http://localhost:8080/photark/admin/upload.html");
    Thread.sleep(3000);
   
View Full Code Here

  @Test
  public void testAdmin() throws FailingHttpStatusCodeException, MalformedURLException, IOException, InterruptedException {
    //passing credentials
    final List collectedAlerts = new ArrayList();
    webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts));
    ((DefaultCredentialsProvider) webClient.getCredentialsProvider()).addCredentials("admin", "password");

    final HtmlPage page = webClient.getPage("http://localhost:8080/photark/admin/upload.html");
    Thread.sleep(3000);
   
View Full Code Here

    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();
    webClient.setAlertHandler(alertHandler);
    token = createToken("canonical", "john.doe");
    language = null;
    server.clearDataServiceError();
  }
View Full Code Here

        // HtmlUnit
        WebClient webClient = new WebClient();

        final List<String> collectedAlerts = new ArrayList<String>( 4 );
        webClient.setAlertHandler( new CollectingAlertHandler( collectedAlerts ) );

        HtmlPage page = (HtmlPage) webClient.getPage( jsTest.toURI().toURL() );
        assertNotNull( page );

        HtmlElement element = page.getHtmlElementById( "contentBox" );
View Full Code Here

    protected void setUp() throws Exception {
        //New HTMLunit web client
        _webClient = new WebClient(BrowserVersion.MOZILLA_1_0);
        //System.out.println("SETTING ALERT HANDLER");
        _webClient.setAlertHandler( new CollectingAlertHandler(collectedAlerts) );
        _webClient.setRedirectEnabled(true);
        // Going to have the WebClient connect to this URL
        _url = new URL(testUrl);
    }
View Full Code Here

    webClient.setAjaxController(new NicelyResynchronizingAjaxController());
    webClient.waitForBackgroundJavaScript(2000);
    webClient.setHTMLParserListener(HTMLParserListener.LOG_REPORTER);
    webClient.setTimeout(3000);

    alertHandler = new CollectingAlertHandler();
    webClient.setAlertHandler(alertHandler);
    token = createToken("canonical", "john.doe");
    language = null;
    server.clearDataServiceError();
  }
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.CollectingAlertHandler

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.