A Troubleshooting - essenius/FitNesseFitSharpFibonacciDemo GitHub Wiki
Setting up FitNesse with FitSharp can be somewhat complicated as there is quite a bit of flexibility in configuring it. That's why the readme has a step-by-step explanation on how to set things up. However, if problems occur, these are things you can look at.
First of all, make sure that you have the .NET 6 SDK or the .NET 6 runtime installed so you have the dotnet
command available.
Try it out by opening a command prompt and typing dotnet
. If you get an error message, you need to install .NET 6. The runtime should not require administrative privileges, if you download the zip file and unzip it to e.g. %LOCALAPPDATA%\dotnet
. You then also need to add this folder to your profile's path. If after doing all this you type dotnet
again, you should see:
% dotnet
Usage: dotnet [options]
Usage: dotnet [path-to-application]
Options:
-h|--help Display help.
--info Display .NET information.
--list-sdks Display the installed SDKs.
--list-runtimes Display the installed runtimes.
path-to-application:
The path to an application .dll file to execute.
On Windows, the base folder is %LOCALAPPDATA%
(which should normally be C:\Users\accountname\AppData\Local
)
- FitNesse - contains
fitnesse-standalone.jar
(the FitNesse application) andplugins.properties
(its configuration file). This is the folder that the-d
parameter of the FitNesse command line points to.- FitNesseRoot - root of the Wiki tree. Should contain
FibonacciTest.wiki
(amongst others). - ExtendedMath - root of the fixture code
-
ExtendedMathFixtures\bin\Deploy\net5.0
should containExtendedMath.dll
,ExtendedMathFixtures.dll
andconfig.xml
. This is the folder you need to be in when you start FitNesse
-
- FitNesseRoot - root of the Wiki tree. Should contain
- FitSharp - the FitSharp test runner
-
lib\net6.0
should containRunner.dll
andfitSharp.dll
-
On Macs, the base folder is ~/Documents
, the rest is the same (except for the folder separator)
Also make sure that the following FitNesse variables are set correctly:
Both PC and Mac:
FIXTURE_FOLDER=.
COMMAND_PATTERN=%m ${FITSHARP_HOME}/Runner.dll -c ${FIXTURE_FOLDER}/config.xml
TEST_RUNNER=dotnet
PC:
FITSHARP_HOME=${LOCALAPPDATA}\\FitSharp\\lib\\net6.0
Mac:
FITSHARP_HOME=${HOME}/Documents/FitSharp/lib/net6.0
The command pattern tells FitNesse how to run the test runner. The -c
parameter specifies the config file which is by convention called config.xml
and is expected in the assembly folder.
Could not complete testing: Error SLiM server died before Header Message could be read.
The most likely cause of this is that FitSharp could not find the test assembly. That can mean that config.xml
could not be found, or that it points to the wrong assembly. Check that you started FitNesse from the folder that contains config.xml
, and that config.xml
points to the right assembly.
For deeper troubleshooting you can have a look at the execution log:
It might make sense to copy the Command seen here, break out of FitNesse and run that command in the same folder:
Starting FitNesse on port: 8080
^C%
% dotnet /Users/essenius/Documents/FitSharp/lib/net6.0/Runner.dll -c ./config.xml 1
Suite configuration file './config.xml' does not exist.
Usage:
dotnet [ -r runnerClass ][ -a appConfigFile ][ -c suiteConfigFile ] ...
This shows that it could not find config.xml
. Make sure you started FitNesse from the fixture assembly folder, and that this folder contains config.xml
.
Another possibility would be that the result is something like:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.IO.FileNotFoundException: Could not load file or assembly '/Users/essenius/Documents/FitNesse/ExtendedMath/ExtendedMathFixtures/bin/Deploy/net5.0/ExtendedMathFixturesq.dll'. The system cannot find the file specified.
Here it is more likely that the content of the config.xml
file is not correct. A typo was made in the AddAssembly
entry (q
too many):
<?xml version="1.0" encoding="utf-8" ?>
<suiteConfig>
<ApplicationUnderTest>
<AddAssembly>ExtendedMathFixturesq.dll</AddAssembly>
<AddNamespace>ExtendedMathFixtures</AddNamespace>
</ApplicationUnderTest>
<Settings>
<Runner>fitSharp.Slim.Service.Runner</Runner>
</Settings>
</suiteConfig>
If the execution log shows a result like below screenshot, then FitNesse could not find the FitSharp assembly. In that case, check if the FITSHARP_HOME
variable in plugins.properties
points to the FitSharp assembly folder.
By the way, if you make a change in plugins.properties
, you will need to restart FitNesse before it takes effect (unlike for changes in config.xml
files).
If the dotnet command shows the following, then FitSharp works fine:
% dotnet /Users/essenius/Documents/FitSharp/lib/net6.0/Runner.dll -c ./config.xml 1
Slim -- V0.5
If that is the case, you can break out of it, restart FitNesse and check if your problem is solved.