Examples of WebForm


Examples of com.meterware.httpunit.WebForm

    // Click the add link
    resp = resp.getLinkWith(Util.getBundle("view", "buttonAddAddress")).click();
   
    // Enter the new data in the form
    WebForm form = resp.getForms()[1];

    // Make sure this is a new form
    assertEquals(form.getParameterValue("{actionForm.name}"), "");
   
    // Set the new values
    form.setParameter( "{actionForm.name}", "TestAddress" );
    form.setParameter( "{actionForm.addr1}", "1234 Main Street" );
    form.setParameter( "{actionForm.addr2}", "Apt 123" );
    form.setParameter( "{actionForm.city}", "Seattle" );
    form.setParameter( "{actionForm.state}", "WA" );
    form.setParameter( "{actionForm.zip}", "98104" );
    form.setParameter( "{actionForm.country}", "USA" );
    form.setParameter( "{actionForm.phone}", "206-333-1234" );
   
    // Submit
    resp = form.submit();
   
    // Make sure the address took
    WebTable table = resp.getTableWithID("address_TestAddress");
    assertNotNull(table);
    TableCell cell = table.getTableCell(0, 0);
View Full Code Here

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
TOP
Copyright © 2018 www.massapi.com. 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.