Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

How do you test the web applications (both server side and client side code)? The testing method has to work irrespective of the framework used (struts, spring web mvc) etc.

I am using Java for the server side code, Javascript and HTML for the client side code.

This is the sample test case of what I am talking about:

 1. When you click on a link, the pop up opens.
 2. Change some value in the pop up (say a drop down value) and it gets saved 
    in the DB.
 3. Click the popup again, you get the changed values.

Can we simulate this kind of thing using unit test cases? Is JUnit enough for this?

share|improve this question
    
What framework are you using? Why aren't you using ordinary Java unit tests for this? A "pop-up" sounds like JavaScript, running in the browser; is that what you're testing? –  S.Lott Jun 3 '11 at 10:06
    
Testing a complete java application with popups, links , tables , forms etc –  Vinoth Kumar Jun 3 '11 at 10:15
    
"popups"? I'll ask this again. "A "pop-up" sounds like JavaScript, running in the browser; is that what you're testing?" Are you trying to test javascript, running in the browser? –  S.Lott Jun 3 '11 at 10:16
    
yes. I mean , I open a new form using a javascript ..window.open(...)..after that i test the elements in the popup..the submit of the popup goes to the server side code. –  Vinoth Kumar Jun 3 '11 at 10:18
2  
Now that this is clear. Please update the question to list, carefully and completely, the languages you are using. Make bullets to include "Java", "JavaScript", "HTML", "SQL" and all languages you want to test. Please update the question so that others are not forced to read a lot of comments. –  S.Lott Jun 3 '11 at 10:23
add comment

3 Answers 3

up vote 7 down vote accepted

To simulate UI clicks and pop-ups, you need Selenium.

Selenium automates browsers. That's it. What you do with that power is entirely up to you. Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) also be automated as well.

Selenium has the support of some of the largest browser vendors who have taken (or are taking) steps to make Selenium a native part of their browser. It is also the core technology in countless other browser automation tools, APIs and frameworks...

share|improve this answer
    
There are other tools besides Selenium, as well. I've never used it, but Watir can be used to automated testing across a number of browsers. Some people I know prefer Watir to Selenium, but it depends on your (and your team's) background and knowledge. –  Thomas Owens Jun 3 '11 at 12:29
2  
@Thomas Owens: That sounds like a separate answer. Please post it so it can be upvoted on it's own merits. –  S.Lott Jun 3 '11 at 12:31
1  
+1 Selenium rocks. I've used Watir as well, but prefer Selenium because of SeleniumGrid. Really easy to set up and distribute automated tests across many different browsers/OS platforms. –  Ryan Hayes Jun 3 '11 at 15:07
add comment

In addition to Selenium (as mentioned by S.Lott), tools like Watir can be used to automated testing across a number of browsers. I've never used it, but some people I know prefer Watir to Selenium, but it depends on your (and your team's) background and knowledge.

In my experiences, you would typically use these tools in conjunction with other testing tools. Since you mentioned this was a Java system, I would recommend JUnit for unit testing and Selenium or Watir for system testing and some acceptance testing. Human interaction would be necessary to complete acceptance testing and perform usability testing, however.

share|improve this answer
add comment

To simulate the UI clicks and pop-ups you will need HttpUnit framework.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.