Q

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

abcd

Failed to log in or username unrecognized

Login matt@aaa.com

abcd

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

def

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!

This was first published in December 2013

Dig deeper on Software Testing Tools and Frameworks

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.
Related Discussions

Matt Heusser asks:

What kind of testing do you favor?

2  Responses So Far

Join the Discussion

2 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchSOA

TheServerSide

SearchCloudApplications

SearchAWS

SearchBusinessAnalytics

SearchFinancialApplications

SearchHealthIT

Close