Package com.meterware.httpunit

Examples of com.meterware.httpunit.TableCell


    WebResponse resp = Util.navToAddresses();

    // Get the newly added address
    WebTable table = resp.getTableWithID("address_TestAddress");
    assertNotNull(table);
    TableCell cell = table.getTableCell(0, 0);
    assertNotNull(cell);
   
    // 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);
    assertNotNull(cell);
    assertTrue(cell.getText().contains("EditedTestAddress"));
    assertTrue(cell.getText().contains("543 Main Street"));
    assertTrue(cell.getText().contains("Unit 345"));
    assertTrue(cell.getText().contains("Portland"));
    assertTrue(cell.getText().contains("OR"));
    assertTrue(cell.getText().contains("98799"));
    assertTrue(cell.getText().contains("USA2"));
    assertTrue(cell.getText().contains("208-222-3456"));   
   }
View Full Code Here


    WebResponse resp = Util.navToAddresses();

    // Get the newly added address
    WebTable table = resp.getTableWithID("address_EditedTestAddress");
    assertNotNull(table);
    TableCell cell = table.getTableCell(0, 0);
    assertNotNull(cell);
   
    // Click the remove link
    resp = cell.getLinkWith(Util.getBundle("view", "buttonRemove")).click();
   
    // Make sure it's gone
    table = resp.getTableWithID("address_EditedTestAddress");
    assertNull(table);
   }
View Full Code Here

TOP

Related Classes of com.meterware.httpunit.TableCell

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.