Debugging Fitnesse (SLIM)

FitNesse is one of wiki based frameworks available in the open source world which can be used for projects which require

  • Acceptance Testing
  • Integration Testing
  • BDD ( Behavior Driven Development) etc

One of the most obvious reasons why FitNesse is so popular is readability factor. Tests written in FitNesse are readable by humans and can be used as a front end for non technical people to sign off the requirements. One of the powerful features of FitNesse is the way it converts the Tables on wiki to JAVA calls. However, there are times when we need to debug these FitNesse tests to see whats going on.

This blog will cover how one can set up FitNesse pages for debug mode.

Most of the IDEs today provide an option for remote debugging via a port. We can leverage on the same to assist our debugging.

Step 1) Start the FitNesse server

Step 2) Navigate to the page which needs to be debug. For example http://<machine address where FitNesse server has been started>:<port where FitNesse server is listening>/<Name of the Test Case>.

Step 3) Define the following variable on the test page.

!define REMOTE_DEBUG_COMMAND {java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -cp %p %m}

In the above statement make sure to change the port 8000 according to port availability on your machine.

Step 4) Start the test bu using the following parameters

responder=test&remote_debug=true

For example if the Test we wanted to debug was reachable via http://localhost:8080/Test1 then just change the URL to http://localhost:8080/Test1?responder=test&remote_debug=true.

Step 5) Open your favourite IDE. Create a remote debug on port 8000 (as defined Step 3).

Step 6) And we are all set to do some debugging.

Be Sociable, Share!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>