Fitnesse trying to load "defaultPath" as assembly - fitnesse

I am trying to specify a custom converter to Slim by specifying a suite configuration.
When I manually append ?test (the button doesn't appear for some reason), I get the following exception:
__EXCEPTION__:System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Path\To\fitnesse\__defaultPath__'
Any idea why it would be trying to load "defaultPath" as an assembly from the current working directory?
Below is my suite configuration:
<?xml version="1.0" encoding="utf-8" ?>
<suiteConfig>
<ApplicationUnderTest>
<AddAssembly>C:\Path\To\TestsAssembly.dll</AddAssembly>
<AddNamespace>Tests_Namespace</AddNamespace>
<AddAssembly>C:\Path\To\fitSharp.dll</AddAssembly>
</ApplicationUnderTest>
<fitSharp.Machine.Application.Settings>
<Runner>fitSharp.Slim.Service.Runner</Runner>
</fitSharp.Machine.Application.Settings>
<fitSharp.Slim.Service.Service>
<AddOperator>NamespaceToConverter.NullableDecimalConverter</AddOperator>
</fitSharp.Slim.Service.Service>
</suiteConfig>
My Fitnesse wiki page starts like this:
!define TEST_SYSTEM {slim}
!define COMMAND_PATTERN {"%m" -c c:\Path\To\SlimConfig.xml %p}
!define TEST_RUNNER {C:\Path\To\fitsharp\Runner.exe}
|import|
... etc

If you don't have a !path, it defaults to 'defaultPath', so that's what was being passed as the %p parameter. As you discovered, you should remove the %p if you don't have a !path.

I was able to work around the problem by removing the classpath parameter (%p) from COMMAND_PATTERN:
!define COMMAND_PATTERN {%m -c c:\Path\To\SlimConfig.xml}

Related

I'd like to scan the metasploitable2 VM with zap api scan (the docker one) using a context file but it seems the authentication doesn't work

I am working on scan automatisation and trying it on metasploitable2 VM using the following command:
docker container run --rm -v $(pwd):/zap/wrk --name container01 owasp/zap2docker-stable:latest zap-api-scan.py -g gen.conf -t http://192.168.56.104/ -f openapi -d -n fContext.context -U admin -r reporAdmin-test.html
My context file contains the following info:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configuration>
<context>
<name>Default context</name>
<desc/>
<inscope>true</inscope>
<incregexes>http://192.168.56.104/</incregexes>
<tech>
....
<authentication>
<type>2</type>
<strategy>EACH_RESP</strategy>
<pollurl/>
<polldata/>
<pollheaders/>
<pollfreq>60</pollfreq>
<pollunits>REQUESTS</pollunits>
<loggedout>Login failed</loggedout>
<form>
<loginurl>http://192.168.56.104/dvwa/</loginurl>
<loginbody>username={%username%}&password={%password%}</loginbody>
<loginpageurl>http://192.168.56.104/dvwa/login.php</loginpageurl>
</form>
</authentication>
<users>
<user>2;true;YWRtaW4=;2;YWRtaW4=~cGFzc3dvcmQ=~</user>
<user>3;true;dXNlcg==;2;dXNlcg==~dXNlcg==~</user>
<user>4;true;dXNlcnA=;2;dXNlcg==~cGFzc3dvcmQ=~</user>
</users>
<forceduser>2</forceduser>
The context file has been generated via the UI of zap.
There's the right user and password set (admin & password) for the page http://192.168.56.104/dvwa/login.php and in the command I specify I that I want to use the user admin.
I get the following report:
summary screenshot
I get the same without using -U admin parameter, So I guess I missed something about authentication but I can't figure what it is.
The problem is that I have a small report, not including all the page of dvwa (SQL injection pages, XSS vulnerable pages etc.)
The following pages should also be scaned
Thanks for your help !

Fitnesse: Connection Reset

I am running tests in fitnesse with the following issue occurring:
Internal Exception:
Connection Reset
Does anyone know why this is occurring and how to fix it?
SuiteSetup contains file:
!define TEST_SYSTEM {fit}
!define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer, C:\GrowthEdition.QA\fitnesse\fitSharp\fit.dll %p}
!define TEST_RUNNER {C:\GrowthEdition.QA\fitnesse\fitSharp\Runner.exe}
!define COLLAPSE_SETUP {true}
!define COLLAPSE_TEARDOWN {true}
!define MANUALLY_START_TEST_RUNNER_ON_DEBUG {debug}
!path C:\GrowthEdition.QA\fitnesse\fitSharp\*.dll
!path C:\Users\rdixit\Documents\Visual~3\Projects\LearningTestAutomation\LearningTestAutomation\bin\x86\Debug\LearningTestAutomation.dll
I assume that you started Fitnesse server ok. And you are working on a Fitnesse wiki page and your test fixture.
The connection reset happens when your test is trying to connect a web server but it's failed. You may need to debug your test to see what it is connecting.
I put a guideline link for reference.
https://vikashazrati.wordpress.com/2007/12/05/remote-debugging-fitnesse-with-eclipse/

Fitnesse: test ignored

When running a fitnesse test, I get see it is ignored (not run). I dont understand why. below is the code:
#!include .ActionDefinitions
!path C:\Users\rdixit\Documents\Visual~3\Projects\LearningTestAutomation\LearningTestAutomation\bin\Debug\LearningTestAutomation.dll
|!SpecFlow.ActionIO|
|start browser| firefox| of version|36|
|navigate to url|https://csb-qaprod.cornerstoneondemand.com/learning|
|login|
Can you tell me why this page is ignored?
The root page is below:
!define TEST_SYSTEM {fit}
#!define COMMAND_PATTERN {java -cp %p %m}
#!define TEST_RUNNER {fitlibrary.suite.FitLibraryServer}
!define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer %p}
!define TEST_RUNNER {C:\fitnesse\fitSharp\runner.exe}
#!define TEST_RUNNER {C:\fitnesse\dotnet\FolderRunner.exe}
!path C:/fitnesse/fitlibrary-2.0.jar
#!path ../bin
!path C:/fitnesse/fitnesse-standalone.jar
!path C:/fitnesse/lib/*.jar
!path C:/fitnesse/fitSharp/*.dll
!path C:/fitnesse/dotnet/*.dll
!path C:\Users\rdixit\Documents\Visual~3\Projects\LearningTestAutomation\LearningTestAutomation\bin\Debug\LearningTestAutomation.dll
!define COLLAPSE_SETUP {true}
!define COLLAPSE_TEARDOWN {true}
!include .ActionDefinitions
|Import|
|SpecFlow.ActionIO|
I found the error, when calling
|!SpecFlow.ActionIO|, I put ! inside the column. Its supposed to be:
!|SpecFlow.ActionIO|
works now.

Javac bootclasspath option

I try to add -bootclasspath option when compiling java source like this:
javac -classpath lib/* -target 1.6 -source 1.6 -bootclasspath /usr/lib/jvm/java-7-oracle/lib/*.jar Hello.java
I am getting the following error when compiling:
javac: invalid flag: /usr/lib/jvm/java-7-oracle/lib/dt.jar
Usage: javac <options> <source files>
use -help for a list of possible options
How should I add the bootclasspath parameter?
The shell expands /usr/lib/jvm/java-7-oracle/lib/*.jar to the list of jars, so effectively javac is called like that:
javac ... -bootclasspath /usr/lib/jvm/java-7-oracle/lib/rt.jar /usr/lib/jvm/java-7-oracle/lib/dt.jar ... Hello.java
You can avoid that by putting the path between single quotes:
javac ... -bootclasspath '/usr/lib/jvm/java-7-oracle/lib/*.jar' ... Hello.java
I added this -bootclasspath /usr/lib/jvm/java-7-oracle/jre/lib/rt.jar instad of /usr/lib/jvm/java-7-oracle/lib/*.jar and it worked fine.
Try something like this:
java -bootclasspath $(set -- /usr/lib/jvm/java-7-oracle/lib/*.jar ; IFS=:; echo "$*")
Be running bash when you try it, the bourne again shell is the bee's knees.

FitSharp FormatException when running tests

I installed a clean version of Fitnesse (v20121220) and the latest version of FitSharp (.net 4).
I've created a fitnesse test page but cannot get the tests to run - whenever I try, the tests immediately fail with the following stack trace in the standard output: -
System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at fit.Runner.FitSocket.EstablishConnection(String request)
at fitnesse.fitserver.FitServer.EstablishConnection()
at fitnesse.fitserver.FitServer.Run(IList`1 CommandLineArguments)
at fitnesse.fitserver.FitServer.Run(IList`1 commandLineArguments, Memory memory, ProgressReporter reporter)
at fitSharp.Machine.Application.Shell.Run()
at fitSharp.Machine.Application.Shell.Execute()
at fitSharp.Machine.Application.Shell.RunInCurrentDomain(IList`1 commandLineArguments)
at fitSharp.Machine.Application.Shell.RunInNewDomain(AppDomainSetup appDomainSetup, IList`1 commandLineArguments)
And the following error as Internal Exception: -
Internal Exception:
FitClient: external process terminated before a connection could be established.
My root configuration is pretty basic: -
!define COMMAND_PATTERN {%m -a "FullPathToAcceptanceTests.dll.config" -r fitnesse.fitserver.FitServer,C:\fitnesse\fitsharp\fit.dll %p}
!define TEST_RUNNER {c:\fitnesse\fitsharp\Runner.exe}
!path "FullPathToAcceptanceTests.dll"
Obviously the FullPathToAcceptanceTests points to where my fitnesse acceptance tests code is.
I don't understand why this is happening - I've used Fitnesse / Fitsharp before without problems, but this just doesn't seem to want to work.
I think that this problem might be caused by running Fitnesse on default 80 port.
FitLibrary and Fit are sometimes using the same port, which might cause an issue.
Try using different port.
I have
!path "FullPathToAcceptanceTests.dll"
!define COMMAND_PATTERN {%m -r "fitnesse.fitserver.FitServer,C:\fitnesse\fitsharp\fit.dll" %p}
!define TEST_RUNNER {c:\fitnesse\fitsharp\Runner.exe}

Resources