This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Java in General and the fly likes Webrowsing with Sessions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Java in General
Bookmark "Webrowsing with Sessions" Watch "Webrowsing with Sessions" New topic

Webrowsing with Sessions

Stephen Tallamy

Joined: Jan 08, 2002
Posts: 16
Can anyone help me solve the following problem:
I need to connect to a website, login using a username and password, and then perform a number of actions on the website - e.g. navigate to a page & post some information. How do I do this using Java classes?
Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

Check out HttpUnit
Here's a short description of it:

The normal way to access web sites is via a browser; however, there are times when it is desirable to bypass the browser and access a site from a program, including:
* automated web site testing
* using a web-site as part of a distributed application
HttpUnit makes this easy. Written in Java, HttpUnit emulates the relevant portions of browser behavior, including form submission, basic http authentication, cookies and automatic page redirection, and allows Java test code to examine returned pages as text, an XML DOM, or containers of forms, tables, and links.

hope that helps!

- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
Stephen Tallamy

Joined: Jan 08, 2002
Posts: 16
Looks like a winner. Many thanks for your help.
jQuery in Action, 2nd edition
subject: Webrowsing with Sessions