aspose file tools
The moose likes Testing and the fly likes JUNIT to test a web application Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » Testing
Reply 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: 12
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: 26496
    
  78

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
     
    I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
     
    subject: JUNIT to test a web application
     
    Similar Threads
    Using Transport Security (SSL) in Web Service (CalulatorApp)
    static method or non-static method?
    how to test struts with Junit
    How to design session layer?
    About Layer - SOAP