Meaningless Drivel is fun!*
The moose likes Testing and the fly likes Using Fitnesse for Web Apps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Using Fitnesse for Web Apps" Watch "Using Fitnesse for Web Apps" New topic
Author

Using Fitnesse for Web Apps

Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

In another thread, in another forum, Ilja Preuss intoned:

In my opinion, the most important thing to do is building a strong suite of acceptance tests [for this Web App you're about to refactor.]
I would probably use http://fitnesse.org/ for this.

"Cool," I thought to myself, "I've got a Web App to refactor, and I'd like to write tests, and I'd like to learn a cool tool!" So I checked Fitnesse out (I've looked at it before but never used it.) Now, after spending some time reading and poking around, it seems to me that Fitnesse actually doesn't include any tools for Web site testing -- there are no built-in fixtures for HTTP page requests, form submits, etc.
So, Ilja, what extra pieces would you use? Has somebody already set something up with HttpUnit, for example?


[Jess in Action][AskingGoodQuestions]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Well, first, it seems to be accepted best practice in the Fit community to let the bulk of the tests *not* go through the GUI. The reason is that most often the GUI is much more fluctuating that the business logic, so you don't want your tests for the latter depend on the GUI. (Robert Martin reports from a client who can't change the GUI of a system any longer, because he has thousands of tests going through it.)
Of course you will still need to write tests for the GUi - for web applications there is WATT. As far as I know, it consists of HtmlFixture - which basically checks the structure of a HTML page, and IEFixture, which can be used to script a web session using MS Internet Explorer.
For more information see
http://fitnesse.org/FitNesse.WebAcceptanceTestingTool
http://groups.yahoo.com/group/fitnesse/message/1096
http://groups.yahoo.com/group/fitnesse/message/539
But it also wouldn't be too hard to write some fixtures based on httpunit or something. I did something similar with JfcUnit for Swing and had something running in less than a day (see http://sourceforge.net/projects/jfcfixtures ). There might even be someone on the fitnesse mailing list you could join forces with.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Thanks for the ideas. I will try to report back here on what I end up doing, as I suspect folks might be interested in the results.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Yes, we are.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Laurent Barbier
Greenhorn

Joined: Jun 08, 2004
Posts: 7
Does jWebUnit is well supported in Fitnesse ?

Is there any success story using Fitnesse to make web testing ?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Laurent Barbier:
Does jWebUnit is well supported in Fitnesse ?

As you might have interpreted from the discussion, no, it isn't.
But it shouldn't be too difficult to create your own Fixtures for driving some JWebUnit code.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Laurent Barbier:
Is there any success story using Fitnesse to make web testing ?


Well, FitNesse itself is a web app, and is tested by itself, of course.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using Fitnesse for Web Apps
 
Similar Threads
Functional Testing Tool
System Tests
Bob? ... Bob?
Managing Testing Documentation?
Dumbing it down: How or when to let users interact with DSL?