Running Fitnesse Tests from Command Line

Swaraj Chhatre picture Swaraj Chhatre · Jul 9, 2012 · Viewed 6.9k times · Source

When running the Fitnesse tests via command Line I am getting a ClassNotFound Exception

caused by Java.lang.ClassNotFoundException:fitnesse.runner.testRunner

could not find the main class:fitnesse.runner.TestRunner.Program will exit

Kindly help

Thanks

Answer

Mike Stockdale picture Mike Stockdale · Jul 20, 2012

TestRunner is no longer supported. Use http://fitnesse.org/FitNesse.UserGuide.CommandLineRestCommands

Update: link has changed - http://www.fitnesse.org/FitNesse.UserGuide.ControllingFitNesseFromTheCommandLine

Update: link has changed again - http://fitnesse.org/FitNesse.UserGuide.AdministeringFitNesse.ControllingFitNesseFromTheCommandLine

Excerpt from Fitnesse docs:

You can run any REST command (See Restful Services) from the command line by using the -c command line option as follows:

java -jar fitnesse-standalone.jar -c

This starts up fitnesse, runs the command, emits the output to standard out, and then exits.

Most often you will use this to run tests and/or suites from the command line as follows:

java -jar fitnesse-standalone.jar -c "MyTestPage?test&format=text"