Package com.gistlabs.mechanize.document

Examples of com.gistlabs.mechanize.document.AbstractDocument


    addPageRequest("http://test.com",
        newHtml("Test Page", newForm("form").method("post").id("form").enctype("multipart/form-data").addFileInput("fileUpload", "")));
    addPageRequest("POST", "http://test.com/form", newHtml("OK", ""));

    AbstractDocument page = agent().get("http://test.com");
    Form form = page.forms().find("#form");
    form.findUpload(byIdOrName("fileUpload")).setValue(tmpFile);
    AbstractDocument response = form.submit();
    assertEquals("OK", response.getTitle());
  }
View Full Code Here


  public void testFileUploadWithNoFile() throws Exception {
    addPageRequest("http://test.com",
        newHtml("Test Page", newForm("form").method("post").id("form").enctype("multipart/form-data").addFileInput("fileUpload", null)));
    addPageRequest("POST", "http://test.com/form", newHtml("OK", ""));

    AbstractDocument page = agent().get("http://test.com");
    Form form = page.forms().find("#form");

    AbstractDocument response = form.submit();
    assertEquals("OK", response.getTitle());
  }
View Full Code Here

TOP

Related Classes of com.gistlabs.mechanize.document.AbstractDocument

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.