Answer

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

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

Requires Free Membership to View

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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:

Expert Discussion

What kind of testing do you favor?

Matt Heusser
What's your opinion?
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest