File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes httpunit and ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "httpunit and ant" Watch "httpunit and ant" New topic
Author

httpunit and ant

david weikeqi
Greenhorn

Joined: Mar 24, 2011
Posts: 1
hi guys,
I met a problem, it blocked me for a long time.

The code as below,

WebConversation con = new WebConversation();
PostMethodWebRequest req = new PostMethodWebRequest("loginPage.jsp", true);
WebResponse loginResponse = conversation.getResponse(request);
WebForm loginForm = loginResponse .getFormWithName("loginform");
loginForm.setParameter("username", "username");
loginForm.setParameter("password", "password");
loginForm.submit();

When the script was invoked by TestNG, it works well, but with Ant, I need to wait for a long time to get the reponse after submit the form, but from the app console I noticed that it has logged in as soon as the form was submitted.

please help me guys, thanks.



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: httpunit and ant
 
Similar Threads
there is a form, but unable to test the login page.
Authentication
HttpUnit web-app problem
Failed to obtain specified collection Help Me
Testing A Java Web Application