I am getting error in FitNesse while slim communication with browser _ Could not send/receive data with SUT - fitnesse

The error I got is
fitnesse.testsystems.slim.SlimCommunicationException: Could not send/receive data with SUT
FitNesse Code:
!define TEST_SYSTEM {slim}
!path C:\FitNesseUsingSelenium\bin\Debug*.dll
!define COMMAND_PATTERN {%m -r fitSharp.Slim.Service.Runner %p}
!define TEST_RUNNER {C:\FitSharp.2.5.0\lib\net40\Runner.exe}
!|import|
|FitNesseUsingSelenium|
!|FitSeleniumFramework|
|TextInTitle|isTitleCorrect?|
|Google|yes|
|google|no|
|bing|no|
Actually is it opening and closing the browser perfectly but after the instead of displaying the results in FitNesse page, it always throwing the error "Could not complete testing: fitnesse.testsystems.slim.SlimCommunicationException: Could not send/receive data with SUT"
enter image description here
But the same is working perfectly in Java using selenium
Could you please suggest some idea to resolve this issue???

Try adding this line:
!define slim.port {8085}
There seems to a problem in the latest FitNesse version when using Selenium and fitSharp with the default Slim port. This is a workaround for the problem.

Related

using msmtp to send mail via php in docker container does NOT work in all cases

I am having issue making msmtp work in all cases when using php mail function. This is used in a docker container that relay's it to another docker container. It works in some cases but fails in others. See the php code for examples of when it fails/works.
msmtp version 1.8.22
Platform: x86_64-pc-linux-gnu
msmtprc config
host postfix
remove_bcc_headers off
allow_from_override off (When OFF breaks both mail functions)
PHP CODE: I need both cases to work at once
<?php
$to = "me#chrismuench.com";
$subject = "My subject";
$txt = "Hello world!";
$from = 'chris#phppointofsale.com';
$headers = "From: $from";
//1. Works with allow_overide_from on
//2. I get error when allow_overide_from off msmtp: account default from /usr/local/etc/msmtprc: envelope-from address is missing
mail($to,$subject,$txt,$headers);
//Never works in either case (The php library I use does this and I do NOT want to modify core). (same error message with on/off for allow_overide_from)
//Error msmtp: cannot use both --from and --read-envelope-from
mail($to, $subject, $txt, $headers, '-f '.$from);
?>

How to connect to a remote slim server using fitnesse

I want to use my slim server remotely with fitnesse but it doesn’t work because the fitnesse always want start the slim server locally.
The problem:
On hostA there is a standalone fitnesse server (started from command prompt with „java -jar fitnesse-standalone.jar -p 8080” command) with a very simple textfixture:
!define TEST_SYSTEM {slim}
!define slim.host {hostB}
!define slim.port {8090}
!define slim.pool.size {2}
!|script|Count|
|count|
|count|
|check|counter|12|
|count|
|count|
|check|counter|4|
|count|
|count|
|check|counter|6|
On hostB I have a slim server which listens on port 8090.
If I start the fixture I get the following error message:
„Unable to start test system 'slim': java.io.IOException: Cannot run program ""c:\Program Files (x86)\Java\jre7\bin\java"": CreateProcess error=2, The system cannot find the file specified”
It seems that fitnesse want to start the slim server anyway locally because if I define the test runner:
!define TEST_RUNNER {<path>/to/my/slimserver/mycslim.exe}
!define COMMAND_PATTERN {%m}
It works but this is not the behavior what I need. I thought If I define the slim.host and slim.port fitnesse will connect to the hostB automatically without starting the slim server locally.
It is possible to configure the fitnesse server to connect to a remote slim server without starting it locally?
Thanks for help!
I have written a custom TestSystem to achieve this. The key is the client builder.
public class CustomClientBuilder extends SlimClientBuilder {
public CustomClientBuilder(Descriptor descriptor) {
super(descriptor);
}
#Override
public SlimCommandRunningClient build() throws IOException {
Object commandRunner = new MockCommandRunner(this.getExecutionLogListener());
return new SlimCommandRunningClient((CommandRunner)commandRunner, this.determineSlimHost(), this.getSlimPort(),
this.determineTimeout(), this.getSlimVersion(), this.determineSSL(),
this.determineHostSSLParameterClass());
}
}
Use this client builder in your test system factory:
public class CustomTestSystemFactory implements TestSystemFactory {
private final SlimTableFactory slimTableFactory;
private final CustomComparatorRegistry customComparatorRegistry;
public CustomTestSystemFactory(SlimTableFactory slimTableFactory,
CustomComparatorRegistry customComparatorRegistry) {
this.slimTableFactory = slimTableFactory;
this.customComparatorRegistry = customComparatorRegistry;
}
public final TestSystem create(Descriptor descriptor) throws IOException {
SlimClientBuilder clientBuilder = new CustomClientBuilder(descriptor);
SlimCommandRunningClient slimClient = clientBuilder.build();
HtmlSlimTestSystem testSystem = new HtmlSlimTestSystem(clientBuilder.getTestSystemName(),
slimClient, this.slimTableFactory.copy(), this.customComparatorRegistry);
return testSystem;
}
}

Fitnesse : Testing was interrupted and results are incomplete. Test Pages:

I am new to the fitnesse framework. I create the test using the https://schuchert.wikispaces.com/FitNesse.Tutorials.1 link.
But I am getting the following error while running it.
Testing was interrupted and results are incomplete. Test Pages: 0 right, 0 wrong, 0 ignored, 0 exceptions Assertions: 0 right, 0 wrong, 0 ignored, 0 exceptions (0.052 seconds)
Unable to start test system 'fit': java.lang.NullPointerException
Kindly help.
I have seen this same error recently whilst using DbFit version 3.1.0 which uses FitNesse v20140903 under the hood. I resolved this by adding the following to my root page ...
!define COMMAND_PATTERN {java -cp %p %m}
Before first test table you should add three important lines:
!define COMMAND_PATTERN {%m %p}
!define TEST_RUNNER {C:\Probjects\HelloWorld\binary\NetRunner.Executable.exe}
!path C:\Probjects\HelloWorld\bin\Debug\FitNesseHelloWorld.dll
First describes the command pattern (for Java - {java -cp %p %m} )
Second has path to the runner (I'm not sure that it is required for Java application)
Third has path to the your test library (to the your jar file)
https://github.com/imanushin/NetRunner/wiki/Create-the-first-test
I could catch this error on my local environment. Please check the path to the your Runner, because the same error is presented if the path is wrong
I have resolved this by adding the following in root page
!define CLASSPATH_PROPERTY {CLASSPATH}
Also removed the -cp %p
After that it started working

Running soffice (libreoffice or openoffice) from command line in ruby on rails

I have an application which I would like to use libreoffice to batch convert files to html. I have the following method:
def set_versioned_odt
condition = %x(soffice --invisible --convert-to html /path/to/file.odt --outdir /path/to/dir/)
if condition
Rails.logger.info "This has been finished"
else
Rails.logger.info "This failed..."
end
end
When I run this method in the application. It will return a failing statement; however, if I run this command in the rails console, soffice will process correctly. Does anyone know what I am doing wrong in the rails app?
Thanks.
Best guess is that soffice isn't in the path. try specifying the full path to soffice.

launch cassandra-cli error

I get the following errors when I try to run cassandra-cli.
manuzhang#manuzhang-U24E:~/git/cassandra-trunk$ bin/cassandra-cli -h localhost -p 9160
Column Family assumptions read from /home/manuzhang/.cassandra-cli/assumptions.json
Connected to: "Test Cluster" on localhost/9160
Welcome to Cassandra CLI version Unknown
Exception in thread "main" java.lang.AssertionError
at org.apache.cassandra.cli.CliClient.loadHelp(CliClient.java:178)
at org.apache.cassandra.cli.CliClient.getHelp(CliClient.java:171)
at org.apache.cassandra.cli.CliClient.printBanner(CliClient.java:197)
at org.apache.cassandra.cli.CliMain.main(CliMain.java:312)
That line is:
final InputStream is = CliClient.class.getClassLoader().getResourceAsStream("org/apache/cassandra/cli/CliHelp.yaml");
assert is != null;
The file is actually located in $CASSANDRA_HOME/src/resources/org/apache/cassandra/cli.
I have run it successfully for several times.
well, solved by ant build in terminal.
I think it's because I'm building from source and from time to time I modify some codes.
but just adding several lines of comments cannot reproduce the problem.

Resources