2

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?

5
  • 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
    Commented Jun 3, 2011 at 10:06
  • Testing a complete java application with popups, links , tables , forms etc Commented Jun 3, 2011 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
    Commented Jun 3, 2011 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. Commented Jun 3, 2011 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
    Commented Jun 3, 2011 at 10:23

3 Answers 3

7

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...

3
  • 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
    Commented Jun 3, 2011 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
    Commented Jun 3, 2011 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
    Commented Jun 3, 2011 at 15:07
2

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.

1

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.