HTMLUnit can be used to test Websites from the view of a user, you can fill out forms with it and it also supports JavaScript. It simulates a browser and is intended to be used with other test suites like JUnit.
You can get more information about it here: http://htmlunit.sourceforge.net/
An alternative would be the automation tool "Sahi" (http://sahi.co.in/w/sahi). The great advantage is that it's independent from the used browser and operating system.
This can be achieved by installing Selenium as Plug-in for Mozilla Firefox (Version 3.x).
Clicks, typing, and other actions are recorded and a test is generarted, which you can be run in the browser.
See http://seleniumhq.org .