Package com.meterware.httpunit

Examples of com.meterware.httpunit.WebForm.submit()


    WebForm form = resp.getForms()[1];
    form.setParameter( "j_username", userName );
    form.setParameter( "j_password", password );
   
    // Submit
    return form.submit();
  }

  public static WebResponse navToAddresses() throws Exception
  {
    // Sign in as beehive
View Full Code Here


        // Fill the form and submit it
        WebRequest request = new GetMethodWebRequest(getServerUrl());
        WebResponse response = conversation.getResponse(request);
        WebForm formUMLText = response.getForms()[0];
        formUMLText.setParameter("text", "version");
        response = formUMLText.submit();
        // Analyze response
        WebForm[] forms = response.getForms();
        assertEquals(2, forms.length);
        // Ensure the Text field is correct
        assertEquals("version", forms[0].getParameterValue("text"));
View Full Code Here

        // Fill the form and submit it
        WebRequest request = new GetMethodWebRequest(getServerUrl());
        WebResponse response = conversation.getResponse(request);
        WebForm formUMLText = response.getForms()[0];
        formUMLText.setParameter("text", "");
        response = formUMLText.submit();
        // Analyze response
        WebForm[] forms = response.getForms();
        assertEquals(2, forms.length);
        // Ensure the Text field is empty
        assertNull(forms[0].getParameterValue("text"));
View Full Code Here

        // Fill the form and submit it
        WebRequest request = new GetMethodWebRequest(getServerUrl());
        WebResponse response = conversation.getResponse(request);
        WebForm formUrl = response.getForms()[1];
        formUrl.setParameter("url", "");
        response = formUrl.submit();
        // Analyze response
        WebForm[] forms = response.getForms();
        assertEquals(2, forms.length);
        // Ensure the Text field is empty
        assertNull(forms[0].getParameterValue("text"));
View Full Code Here

        // Fill the form and submit it
        WebRequest request = new GetMethodWebRequest(getServerUrl());
        WebResponse response = conversation.getResponse(request);
        WebForm formDitaaText = response.getForms()[0];
        formDitaaText.setParameter("text", "@startditaa \n*--> \n@endditaa");
        response = formDitaaText.submit();
        // Analyze response
        WebForm[] forms = response.getForms();
        assertEquals(2, forms.length);
        // Ensure the Text field is correct
        assertTrue(forms[0].getParameterValue("text").startsWith("@startditaa"));
View Full Code Here

        // Fill the form and submit it
        WebRequest request = new GetMethodWebRequest(getServerUrl());
        WebResponse response = conversation.getResponse(request);
        WebForm formText = response.getForms()[0];
        formText.setParameter("text", "@startuml \nBob -> Alice : [[http://yahoo.com]] Hello \n@enduml");
        response = formText.submit();
        // Analyze response
        // Ensure the generated image is present
        assertNotNull(response.getImageWithAltText("PlantUML diagram"));
        // Ensure the image map is present
        HTMLElement[] maps = response.getElementsByTagName("map");
View Full Code Here

    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

    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

       
      // Set the search term
      form.setParameter( "{actionForm.keyword}", searchTerm );
 
      // Submit
      return form.submit();
     }
}
View Full Code Here

     * @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();
    }

    /**
     * Used for debugging testcases
     * @param resp webresponse
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.