Fitnesse: Connection Reset - fitnesse

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/

Related

Debugging an Erlang code with eunit in IntelliJ

IDE: IntelliJ IDEA 2022.2.2
I set a breakpoint in my Erlang code which has eunit testcases.
In order to debug it, I clicked on "Run --> Debug". I got an error "Test suite was cancelled". What could be the reason?
"C:\Program Files\Erlang OTP\bin\erl.exe" -pa C:\Users\bhu\AppData\Local\Temp\intellij_erlang_debugger_7789 -pa C:/Users/bhu/AppData/Local/Temp/eunit_teamcity9 -pa F:/1TB/P/workspace-IntelliJ-Erlang1/out/test/workspace-IntelliJ-Erlang1 -pa F:/1TB/P/workspace-IntelliJ-Erlang1 -run debugnode main 50067 -noshell -s init stop
Testing started at 20:59 ...
** Invalid beam file or no abstract code: "F:\\1TB\\P\\workspace-IntelliJ-Erlang1\\src\\my_sort.erl"
Test suite was cancelled. Reason: {abort,{module_not_found,my_sort}}
The error means that the module my_sort was not loaded into the VM. You can find the function here. I think this is because the search path to your module my_sort is not added to the code path using the flag -pa /mypath/my_sort.erl.
Could you try to add to the code path using -pa ..?

Unable to run command line for iOS UI Automation

I used the template from this website: http://blog.manbolo.com/2012/04/08/ios-automated-tests-with-uiautomation and created my own command line to run the automation test on terminal.
Here are some useful information about my script:
I'm using xCode 6.4.
I ran this automation script in Xcode instrument and it works fine.
Here is my command line:
instruments -w 927b666816e2d4377b208a872b42a1d3xxxxxxxx -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate ConsumeriOS -e UIASCRIPT/Users/wendywang/Documents/TIO/ConsumeriOS/ConsumeriOS/ConsumeriOSTests/automationScript/LogIn.js
But I received this error:
2015-10-05 14:16:34.122 instruments[23330:551118] WebKit Threading Violation - initial use of WebKit from a secondary thread. Instruments Usage Error : Failed to resolve target for Instrument 'Automation' instruments, version 6.4 (57082) usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]] tio-spare:~ wendywang$ ConsumeriOS -e UIASCRIPT /Users/wendywang/Documents/xxx/ConsumeriOS/ConsumeriOS/ConsumeriOSTests/automationScript/LogIn.js -bash: ConsumeriOS: command not found
I double checked that
The UDID is correct
The automation trace template is in the correct path
The LogIn.js file is in the correct path
One thing I am not sure:
The ConsumeriOS is the name of the code. But inside the code, it can actually produce a few apps. I am testing the app called Consumer. So I am not sure if I should write ConsumeriOS as the name of the app, or Consumer instead.
Does anyone know why it is generating this error? Thanks!
Huhu,
try this:
Give the
complete path to the app with the .app extension,
Put the DeviceID and the script into "",
try it with the device name, if it doesn't
work.
Here a sample that works for me.
instruments -w "DeviceID" -t PATHTOTEMPLATE/Automation.tracetemplate PATHTOAPP/ConsumeriOS.app -e UIASCRIPT "PATHTOSCRIPT/UITest.js"
Let me know!
The relevant message is this one:
tio-spare:~ wendywang$ ConsumeriOS -e UIASCRIPT /Users/wendywang/Documents/xxx/ConsumeriOS/ConsumeriOS/ConsumeriOSTests/automationScript/LogIn.js -bash: ConsumeriOS: command not found
It appears that you may have copy-pasted this command:
instruments -w 927b666816e2d4377b208a872b42a1d3xxxxxxxx -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate ConsumeriOS -e UIASCRIPT/Users/wendywang/Documents/TIO/ConsumeriOS/ConsumeriOS/ConsumeriOSTests/automationScript/LogIn.js
But incorrectly -- in two separate pieces, part 1:
instruments -w 927b666816e2d4377b208a872b42a1d3xxxxxxxx -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate
And part 2 (separated by a newline):
ConsumeriOS -e UIASCRIPT/Users/wendywang/Documents/TIO/ConsumeriOS/ConsumeriOS/ConsumeriOSTests/automationScript/LogIn.js
Separately, it looks like you wrote the name of your app (ConsumeriOS) instead of the full path to your app (/path/to/ConsumeriOS.app).

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.

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}

Fitnesse trying to load "defaultPath" as assembly

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}

Resources