Meaningless Drivel is fun!
The moose likes Testing and the fly likes JUNIT to test a web application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "JUNIT to test a web application" Watch "JUNIT to test a web application" New topic

JUNIT to test a web application

SaravanaKumar Venugopal

Joined: May 12, 2012
Posts: 20
Is there a way to test the web application(My application uses Jsp, Servlet and Struts) starting from Presenatation layer to DAO layer with Ant script.

If there is a method, please provide a sample script
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

Ant would just run the junit test so the Ant part isn't important to the question. There are two main approaches.

  • Test in browser - selenium is most common. It offers a junit interface but you need a browser installed
  • Test from URL but without browser - JWebUnit is good here
  • Forget about the URL and start at the servlet/struts action/spring controller/etc. - Here you can just use JUnit in container testing

  • [OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
    Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
    I agree. Here's the link:
    subject: JUNIT to test a web application
    It's not a secret anymore!