Setting Up FitNesse for .NET on Windows

Setting Up FitNesse for .NET on Windows

21 May 2024 Stephan Petzl Leave a comment Tech-Help

Getting started with FitNesse for .NET can initially seem daunting, especially with the various steps involved. This guide aims to simplify the setup process and ensure you can run your tests efficiently.

Prerequisites

  • Java Runtime Environment (JRE) installed on your machine.
  • FitNesse jar file, which can be downloaded from the FitNesse website.
  • .NET development environment, such as Visual Studio.

Step-by-Step Setup Guide

1. Download and Run FitNesse

First, download the FitNesse jar file from the official website. To start the FitNesse server, open a command prompt and navigate to the directory containing fitnesse.jar. Run the following command:

java -jar fitnesse.jar

This will start the web server and create a folder named FitNesseRoot with the necessary wiki contents. You can verify the server is running by navigating to http://localhost in your web browser.

2. Create a Test Page

On the FitNesse front page, edit the page to add a new test page. Enter a name in CamelCase, such as HelloWorldTest, at the bottom and save. Click on the question mark that appears next to the name to create the new page. In the Properties section, ensure the page type is set to Test.

3. Download and Setup FitSharp

FitSharp is a .NET test runner for FitNesse. Download FitSharp from the FitSharp GitHub page and extract it to a folder named fitsharp next to the FitNesseRoot folder.

4. Create a .NET Test Project

In Visual Studio, create a new .NET project for your tests. Add references to fit.dll and fitSharp.dll located in the fitsharp folder. Write a simple test, such as a column fixture, and compile the project. For guidance on fixtures, refer to the FitNesse user guide.

5. Configure FitNesse to Run .NET Tests

On your FitNesse test page (e.g., HelloWorldTest), add the following configuration at the top:

!define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,fitsharp\\fit.dll %p}
!define TEST_RUNNER {fitsharp\\Runner.exe}
!path <path to your test assembly>

If you encounter issues, try using RunnerW.exe for troubleshooting. For more detailed instructions, you can refer to the test exception handling documentation.

Additional Resources

For comprehensive coverage of FitNesse and .NET integration, consider reading the book Test Driven .NET Development With FitNesse.

Automating Tests with Repeato

If you are looking for an efficient way to automate your tests without delving into complex code, consider using Repeato. Repeato is a no-code test automation tool for iOS and Android that simplifies the process of creating, running, and maintaining automated tests for your apps. Its intuitive test recorder and computer vision-based approach make it particularly fast and user-friendly. Additionally, Repeato supports running tests inside Android emulators or devices, with explicit web testing support coming soon. To learn more, visit our homepage or check out our getting started guide.

Like this article? there’s more where that came from!