/** * Creates and returns a web request which will simulate the submission of this form by pressing the specified button. * If the button is null, simulates the pressing of the default button. **/ public WebRequest getRequest( SubmitButton button ) { return getRequest( button, 0, 0 ); }
/** * Creates and returns a web request which will simulate the submission of this form with an unnamed submit button. **/ public WebRequest getRequest() { return getRequest( (SubmitButton) null ); }
/** * Creates and returns a web request which will simulate the submission of this form by pressing the specified button. * If the button is null, simulates the pressing of the default button. **/ public WebRequest getRequest( SubmitButton button ) { return getRequest( button, 0, 0 ); }
/** * Creates and returns a web request which will simulate the submission of this form with an unnamed submit button. **/ public WebRequest getRequest() { return getRequest( (SubmitButton) null ); }
/** * Creates and returns a web request which will simulate the submission of this form by pressing the specified button. * If the button is null, simulates the pressing of the default button. **/ public WebRequest getRequest( SubmitButton button ) { return getRequest( button, 0, 0 ); }
/** * Creates and returns a web request which will simulate the submission of this form with an unnamed submit button. **/ public WebRequest getRequest() { return getRequest( (SubmitButton) null ); }
/** * Submits the form without also invoking the button's "onclick" event. */ WebResponse doFormSubmit( SubmitButton button ) throws IOException, SAXException { return submitRequest( getAttribute( "onsubmit" ), getRequest( button ) ); }
/** * Creates and returns a web request which will simulate the submission of this form with a button with the specified name and value. **/ public WebRequest getRequest( String submitButtonName, String submitButtonValue ) { SubmitButton sb = getSubmitButton( submitButtonName, submitButtonValue ); if (sb == null) throw new IllegalSubmitButtonException( submitButtonName, submitButtonValue ); return getRequest( sb ); }
/** * Creates and returns a web request which will simulate the submission of this form with a button with the specified name. **/ public WebRequest getRequest( String submitButtonName ) { SubmitButton sb = getSubmitButton( submitButtonName ); if (sb == null) throw new IllegalSubmitButtonException( submitButtonName, "" ); return getRequest( sb ); }
/** * Submits the form without also invoking the button's "onclick" event. */ WebResponse doFormSubmit( SubmitButton button ) throws IOException, SAXException { return submitRequest( getAttribute( "onsubmit" ), getRequest( button ) ); }
/** * Submits the form without also invoking the button's "onclick" event. */ WebResponse doFormSubmit( SubmitButton button ) throws IOException, SAXException { return submitRequest( getAttribute( "onsubmit" ), getRequest( button ) ); }
/** * Creates and returns a web request which will simulate the submission of this form with a button with the specified name and value. **/ public WebRequest getRequest( String submitButtonName, String submitButtonValue ) { SubmitButton sb = getSubmitButton( submitButtonName, submitButtonValue ); if (sb == null) throw new IllegalSubmitButtonException( submitButtonName, submitButtonValue ); return getRequest( sb ); }
/** * Creates and returns a web request which will simulate the submission of this form with a button with the specified name. **/ public WebRequest getRequest( String submitButtonName ) { SubmitButton sb = getSubmitButton( submitButtonName ); if (sb == null) throw new IllegalSubmitButtonException( submitButtonName, "" ); return getRequest( sb ); }
/** * Creates and returns a web request which will simulate the submission of this form with a button with the specified name and value. **/ public WebRequest getRequest( String submitButtonName, String submitButtonValue ) { SubmitButton sb = getSubmitButton( submitButtonName, submitButtonValue ); if (sb == null) throw new IllegalSubmitButtonException( submitButtonName, submitButtonValue ); return getRequest( sb ); }
/** * Creates and returns a web request which will simulate the submission of this form with a button with the specified name. **/ public WebRequest getRequest( String submitButtonName ) { SubmitButton sb = getSubmitButton( submitButtonName ); if (sb == null) throw new IllegalSubmitButtonException( submitButtonName, "" ); return getRequest( sb ); }
WebResponse doFormSubmit( SubmitButton button, int x, int y ) throws IOException, SAXException { return submitRequest( getAttribute( "onsubmit" ), getRequest( button, x, y ) ); }
WebResponse doFormSubmit( SubmitButton button, int x, int y ) throws IOException, SAXException { return submitRequest( getAttribute( "onsubmit" ), getRequest( button, x, y ) ); }
WebResponse doFormSubmit( SubmitButton button, int x, int y ) throws IOException, SAXException { return submitRequest( getAttribute( "onsubmit" ), getRequest( button, x, y ) ); }
public void testGoodLogin() throws Exception { WebConversation conversation = new WebConversation(); WebRequest request = new GetMethodWebRequest( "http://www.meterware.com/servlet/TopSecret" ); WebResponse response = conversation.getResponse( request ); WebForm loginForm = response.getForms()[0]; request = loginForm.getRequest(); request.setParameter( "name", "master" ); response = conversation.getResponse( request ); assertTrue( "Login not accepted", response.getText().indexOf( "You made it!" ) != -1 ); assertEquals( "Page title", "Top Secret", response.getTitle() ); }