If I have java-webapp (servlets), what is the best way to create automated tests for this application?
Should I start a server? But that is very fragile. Should I call the servlets directly? But how can this be done? I don't know how to create a ServletResponse/ServletRequest.
And what is the best way to test the functionality of the webapp? Should I check the generated HTML-text? But if I change the templates (typo) the test is broken.
What are your best practices and experiences with testing webapps?