Saturday, July 9, 2011

Starting a FitNesse project with fitSharp

FitNesse and fitSharp offer so much flexibility that there's many different ways to configure a project, but for the beginner, a common question is: OK, but where do I start? So here's how I set up a sample project.

I got fitnesse.jar from and put it in C:\apps\fitnesse. I got the latest fitSharp release from and unzipped it into c:\apps\fitnesse\dotnet.

I created a Visual Studio solution in c:\projects\fitsharpsample.  I added a class library  project called Fixtures.  I added references to fit.dll and fitsharp.dll from c:\apps\fitnesse\dotnet.  I added a class called SampleDo:
using fitlibrary;

namespace Fixtures {
    public class SampleDo: DoFixture {
        public string Greeting { get { return "hi"; } }
In my solution folder, I created a fitnesseRoot folder. I created a file fitnesse.cmd to run FitNesse:
java -jar \apps\fitnesse\fitnesse.jar -p 8080 -d "c:\projects\fitsharpsample" -r fitNesseRoot
I created a configuration file storytest.config.xml:

In my browser, I went to http://localhost:8080 and clicked the root link and edited the root page to contain:
!define TEST_RUNNER {c:\apps\fitnesse\dotnet\Runner.exe}
!define COMMAND_PATTERN {%m -c c:\projects\fitsharpsample\storytest.config.xml %p}
 I added a SampleTest page in FitNesse:
|sample do|
I ran the test and all green!

Assertions: 1 right, 0 wrong, 0 ignored, 0 exceptions (0.000 seconds)
sample do
check greeting hi


  1. Hi,

    I am getting the below error. Pl guide me where I am wrong. I created fitnesse.config.xml file(application configuration file) and rest part done in the same way.

    Missing runner class

    Runner -r runnerClass [ -a appConfigFile ][ -c runnerConfigFile ] ...

    1. I just leave a comment because I came across the same message.

      One thing that could be happening is that the paths which you set on the root page could include some spaces. If this is the case, you need to be surrounded each path by double quotations.

  2. Thanks. This got me going quickly

  3. Thank you for your article.

    However, once I had a bit trouble that raised an exception for a missing Fixture Type.
    There was a trap at the following setting in my environment:
    !define COMMAND_PATTERN {%m -c c:\projects\fitsharpsample\storytest.config.xml %p}

    Because I had my storytest.config.xml in my Visual Studio project folder "C:\Users\Shinichi\Documents\Visual Studio 2015\Projects\TestableForms\FitSharpSample".

    The folder path contained SPACE character.
    So I had to rewrite that setting with double quotes:
    !define COMMAND_PATTERN {%m -c "C:\Users\Shinichi\Documents\Visual Studio 2015\Projects\TestableForms\FitSharpSample\storytest.config.xml" %p}

    Then, it worked! (All Green!!)

    Anyway, this article is very helpful for me.
    Thank you very match.