Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

FitNesse testing vs. Selenium testing: Which to use and when

SearchSoftwareQuality expert Matt Heusser compares FitNesse testing with Selenium testing and explains the advantages of each.

When is it appropriate to use FitNesse testing versus Selenium testing?

Programmers can probably write Selenium tests in whatever language they write production code in, which can be incredibly powerful.

First, let's talk about the two tools.

I recommend Selenium to automate a Web-based user interface, such as Google Chrome, and FitNesse to define business logic tests in a table so that customers can understand them. Sometimes it is possible to combine the two, expressing the tests in a table, then having FitNesse connect to Selenium over a piece of "bridge" technology called Selenesse.

You can think of Selenium as an essential code library, or application programming interface, to drive the browser. That code library plugs into many languages, from Ruby to Python to Java, even .Net. That means your programmers can probably write Selenium tests in whatever language they write production code in, which can be incredibly powerful. You can write code in Selenium, for example, to take in a specific username, password and expected text, then click-type-click very specific fields. Once the programmers create the function, you can reuse it like so:

login(“matt@xndev.com”,”abcd”,”Failed to Login or Username unrecognized”) ;
login(“matt@aaa.com”,”abcd”,”Failed to Login or Username unrecognized”) ;
login(“matt@xndev.com”,”def”,”Hello Matt”);

In the example above, the first user ID is a bad password, the second a bad email address, while the third passes, showing the welcome screen with a hello message.

The programmers can write a program that calls these functions and directs the output to the screen, then either run the program on command or possibly check it into their continuous integration server.

In order for a customer or less technical user to connect to this sort of check, they'd have to get into version control and read code. Asking what-if questions and re-running the tests might involve a line editor and compile step -- it is unlikely to happen.

FitNesse solves that by creating a "pretty" layer on a wiki, between the code and the user. A FitNesse test for login might look more like this:

Login matt@xndev.com


Failed to log in or username unrecognized

Login matt@aaa.com


Failed to log in or username unrecognized
Login matt@xndev.com


Hello Matt

When the users look at the code on the screen, it will look like a table; clicking Edit exposes the pipe symbol and allows the user to change values and save to ask what-if questions or add new tests.

Of course, with FitNesse, you have to connect to the underlying code somehow and write the login function. FitNesse supports .Net and Java natively, but you can also shell out to any computer program using the command line, then interpret the results that come back.

If you want to test a Web-based application by and for technical people, I'd suggest Selenium. If the purpose is to create executable specifications, especially at the business logic level, start with FitNesse. If the team codes a Web-based application in Java or .Net, you might just want both!

Dig Deeper on Topics Archive

Join the conversation


Send me notifications when other members comment.

Please create a username to comment.

What kind of testing do you favor?
Selenium with Nunit WebDriver
Both, usually
You can use tools such as SpecFlow with Selenium and the like to achieve what is being suggested above.
In my org. we have developed our own wrapper on top of Selenium which expects test creator to provide input in tabular format. So it is easy even for BA to use selenium tool.
Is it possible to perform functional testing like that of UFT with Fitnesse (this does not involve any calculation)?