wood burning stoves*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "JUNIT to test a web application" Watch "JUNIT to test a web application" New topic
Author

JUNIT to test a web application

SaravanaKumar Venugopal
Greenhorn

Joined: May 12, 2012
Posts: 16
All,
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30138
    
150

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


  • [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
    Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
     
    wood burning stoves
     
    subject: JUNIT to test a web application
     
    Similar Threads
    About Layer - SOAP
    how to test struts with Junit
    static method or non-static method?
    Using Transport Security (SSL) in Web Service (CalulatorApp)
    How to design session layer?