Package com.meterware.httpunit

Examples of com.meterware.httpunit.WebForm


   
    // Edit the address by clicking the edit link
    resp = cell.getLinkWith(Util.getBundle("view", "buttonEdit")).click(); // "Edit"
   
    // Enter the new data in the form
    WebForm form = resp.getForms()[1];

    // Make sure this is the right form
    assertEquals(form.getParameterValue("{actionForm.name}"), "TestAddress");
   
    // Set the new values
    form.setParameter( "{actionForm.name}", "EditedTestAddress" );
    form.setParameter( "{actionForm.addr1}", "543 Main Street" );
    form.setParameter( "{actionForm.addr2}", "Unit 345" );
    form.setParameter( "{actionForm.city}", "Portland" );
    form.setParameter( "{actionForm.state}", "OR" );
    form.setParameter( "{actionForm.zip}", "98799" );
    form.setParameter( "{actionForm.country}", "USA2" );
    form.setParameter( "{actionForm.phone}", "208-222-3456" );
   
    // Submit
    resp = form.submit();
   
    // Make sure the address took
    table = resp.getTableWithID("address_EditedTestAddress");
    assertNotNull(table);
    cell = table.getTableCell(0, 0);
View Full Code Here


     {
      // Start the conversation
      WebResponse resp = Util.navToStore();
       
      // Get the search form
      WebForm form = resp.getFormWithName("Netui_Form_0");
       
      // Set the search term
      form.setParameter( "{actionForm.keyword}", searchTerm );
 
      // Submit
      return form.submit();
     }
View Full Code Here

     * @param value parameter value
     * @return new web response
     * @throws Exception
     */
    private WebResponse submitWithParam(WebResponse orig, String formname, String paramname, String value) throws Exception {
        WebForm form = orig.getFormWithName(formname);
        form.setParameter(paramname,value);
        return form.submit();
    }
View Full Code Here

        /* check get('JSESSIONID') */
        resp = submitWithParam(resp,"get","get","JSESSIONID");
        checkTextStart(resp,"get","javax.servlet.http.Cookie");

        /* check add('foo','bar') */
        WebForm form = resp.getFormWithName("add2");
        form.setParameter("add1","foo");
        form.setParameter("add2","bar");
        resp = form.submit();
        resp = submitWithParam(resp,"get","get","foo");
        checkTextStart(resp,"get","javax.servlet.http.Cookie");
    }
View Full Code Here

        /* check getInts(n) */
        resp = submitWithParam(resp,"getInts","getInts","n");
        checkTextStart(resp,"getInts","[I@");

        /* check getString(bar,foo) */
        WebForm form = resp.getFormWithName("getString2");
        form.setParameter("getString1","'bar'");
        form.setParameter("getString2","'foo'");
        resp = form.submit();
        checkText(resp,"getString2","foo");

        /* TODO other getters with default values */

        /* check all */
 
View Full Code Here

TOP

Related Classes of com.meterware.httpunit.WebForm

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.