This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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.
I agree. Here's the link:
subject: Webrowsing with Sessions
Similar Threads
How to save image url from website using java code...
Any future in IT?
String to StringBuffer to synchronized
default page
ping a website