Fitnesse - Issues with assemblies config file

470 Views Asked by At

Below is the page I have in Fitnesse. I have a .NET class file called TestSuiteFitnesse.DLL and in here are the fixtures to populate the SCRIPT table. We pass in the TT1 and Client Registration variables. We have another .NET class file call CRLib.dll. Based on what the value of the variables it does different work. Part of that work is to read from the app.config file and returning values from the section to be used to query a database and structure a return. The problem I am having and I have tried a lot of sites now and can’t seem to find the answer is this. When I run the Fitnesse page I get an error telling me that the code can’t find a section within the app.config. I have read about creating a suite.app or something along those lines but I can’t for the life of me get it working so that it reads the app.config. Its seems to be reading the Config file within the Runner folder, I have copied enter code here in the app.config in there but it still doesn’t read it.

Any help greatly accepted.

<'''CC Client Registration'''>
!contents -R2 -g -p -f -h
!define TEST_SYSTEM {slim}
!define MANUALLY_START_TEST_RUNNER_ON_DEBUG {true}
!define COMMAND_PATTERN {%m -r fitSharp.Slim.Service.Runner,C:\ Fitnesse \release.2.3.net.40\fitsharp.dll %p}
!define TEST_RUNNER {C:\Fitnesse\release.2.3.net.40\Runner.exe}
!define COLLAPSE_SETUP {true}
!define COLLAPSE_TEARDOWN {true}

!path C:\Code\branches\ProcessImprovement\src\dotNet\StandaloneUtilities\TestSuite\TestSuiteFitnesse\bin\Debug\TestSuiteFitnesse.dll

!|import |
|TestSuiteFitnesse|

|script|Register Client|TT1|Client Registration|||
|show|Return Operation|
|show|Run Task|
|show|Get Path|
|show|Get Stream|
|show|Get ID|

This is the Config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <sectionGroup name="Environments">
      <section name="FUT2" type="System.Configuration.NameValueSectionHandler"></section>
      <section name="FUT1" type="System.Configuration.NameValueSectionHandler"></section>
    </sectionGroup>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
  </configSections>

  <appSettings>
    <clear/>
    <!--This key is used to set the devices' base folder.-->
    <add key="DeviceBasePath" value=".\devices"/>
    <!--hpp url -->
    <add key="HPPassport"  value="https://mysite.com/login.fcc?"/>

    <!--This key is used to randomize the device name.-->
    <add key="RandomizeDeviceName" value="FALSE" />

    <!--This key is to define the times of retrying to get device ID via SBS. Between 2 retries there is a break of 5 seconds.--`>`
    <add key="RetryTimes" value="50" />
  </appSettings>
</configuration>
1

There are 1 best solutions below

0
On

Try this:

!define COMMAND_PATTERN {%m -a c:\mypath\myapp.config ... %p}

(from http://fitsharp.github.io/FitSharp/AppConfigFile.html )