jbrugger has asked for the wisdom of the Perl Monks concerning the following question:
// Example code that gives problems in httpunit, i would not know of a + way in perl or any other method... import com.meterware.httpunit.*; import junit.framework.*; public class Ced extends TestCase{ public static void main( String[] params ) { try { // create the conversation object which will maintain stat +e for us WebConversation wc = new WebConversation(); // Obtain the main page on the web site WebRequest request = new GetMethodWebRequest( "http://www. +site.com/cgi-bin/script.pl/12" ); WebResponse response = wc.getResponse( request ); // Print the pagesource if needed. // System.out.println( response.getText() ); // Insert form data WebForm form = response.getFormWithName("LoginForm"); assertNotNull( "No form found with name 'LoginForm'", form + ); form.setParameter("userid", "username"); form.setParameter("password","secret"); // Submit the data WebLink loginbutton = response.getFirstMatchingLink( WebLi +nk.MATCH_CONTAINED_TEXT, "Log in"); response = loginbutton.click(); } catch (Exception e) { System.err.println( "Exception: " + e ); } } } // This generates errors like: Event 'top.ResetTimeOut();' failed: Typ +eError: clearTimeout is not a function.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Automated testing driving me nuts...
by dragonchild (Archbishop) on Jun 13, 2005 at 11:45 UTC | |
by jbrugger (Parson) on Jun 13, 2005 at 11:51 UTC | |
by dragonchild (Archbishop) on Jun 13, 2005 at 12:47 UTC | |
|
Re: Automated testing driving me nuts...
by eyepopslikeamosquito (Archbishop) on Jun 13, 2005 at 15:14 UTC | |
|
Re: Automated testing driving me nuts...
by perrin (Chancellor) on Jun 13, 2005 at 22:38 UTC |