Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlFileInput


        try {
            WebClient wc = new WebClient();
            HtmlPage p = (HtmlPage) wc.getPage("http://localhost:" + localPort + '/');
            HtmlForm f = p.getFormByName("main");
            HtmlFileInput input = (HtmlFileInput) f.getInputByName("test");
            input.setData(testData);
            f.submit();
        } finally {
            server.stop();
        }
    }
View Full Code Here


    String attributeValue = element.getAttribute(HtmlConstants.TYPE);
    if (!HtmlConstants.FILE.equals(attributeValue)) {
      throw new StepFailedException("HTML input with id='" + getHtmlId() + "' is of type '"
        + attributeValue + "' but should be '" + HtmlConstants.FILE + "'", this);
    }
    final HtmlFileInput fileInput = (HtmlFileInput) element;
    fileInput.setValueAttribute(getFileName().getAbsolutePath());
  }
View Full Code Here

    // click on the "Add new resource" button
    DebugUtils.writeFile("target/testDeployWAR-beforeAdd.html", client.getPageAsText());///
    client.click("actionHeaderForm:addNewContent")// 404 if setThrowExceptionOnFailingStatusCode(true) above

    // upload hellothere.war
    HtmlFileInput fileInput = (HtmlFileInput) client.getElement("createContentForm:file");
    fileInput.setContentType("application/war");
    fileInput.setValueAttribute(System.getProperty("jsfunit.testdata") + "/war/hellothere.war");
    client.click("createContentForm:addButton");

    // assert that the success message appeared on the client side
    assertTrue(client.getPageAsText().contains("hellothere.war created successfully"));
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.html.HtmlFileInput

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.