This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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: 32635

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!