Error when passing command line arguments in robot framework - robotframework

I am trying this to pass the argument through command line
robot testingxpath.robot --variable EXAMPLE:value
[ ERROR ] Parsing '--variable' failed: Data source does not exist.
Try --help for usage information.
Not sure what is wrong. Any help is appreciated.

Try robot --variable EXAMPLE:value testingxpath.robot
User guide (ch. 3.1.2) says:
When options are used, they must always be given between the runner
script and the data sources.

Related

Roboframework set variable for RCC command line

The documentation indicates we should be able to change Scalar variables in .robot files when we execute a robot with the command line https://robocorp.com/docs/languages-and-frameworks/robot-framework/variables with the option --variable https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#setting-variables-in-command-line
But every attempt like this rcc run --variable MYVARIABLE:value result with this error Error: [rcc v11.4.3] unknown flag: --variable
How can we define différents variables each time we wan't to execute the robot ?
Looks like variables for RCC have been disabled/removed or not implemented.
The answer --> https://forum.robocorp.com/t/how-to-pass-variables-when-running-rcc/1209
On linux, environment variables have to be used, for example: MYVARIABLE="123" rcc run

How to Mark final result as PASS if one of the Test Suite in Robot Framework Passes?

We have a scenario where we need to run the same test suite on 2 different Geo Redundant servers to check the health. If any one of them passes the final Report & Log should show the suite as pass.
Is there a way in the robot framework to achieve this?
For example, lets say I have following robot file:
Health_Check_Server.robot
*** Test Cases ***
Validate Server
[Arguments] ${Server_credentials}
Login to Server ${Server_credentials}
${HC_Output}= Run Command ${health_check command}
$HC_Status}= Validate Output ${HC_Output}
I want to execute it like:
robot --variable Server_credentials:<ServerA details> Health_Check_Server.robot
robot --variable Server_credentials:<ServerB details> Health_Check_Server.robot
Is there any option in the rebot command using which I can OR the results?
Meaning if any of these Servers are in healthy state, the final results should show PASS. Only if both of the suites failed, the final result should be marked as FAIL.
Thanks in Advance!
Just save each result in separate file, and than merge the result using rebot.
The log will have the test inside as passed, you should see a note if one of the tests was failed.
robot --variable Server_credentials:<ServerA details> --output server_a.xml Health_Check_Server.robot
robot --variable Server_credentials:<ServerB details> --output server_b.xml Health_Check_Server.robot
rebot --merge server_a.xml server_b.xml

Executing R script within R 3.3.1 installed on windows

Sorry for a basic question. I'm trying run a R script called cuffdiff_gtf_attributes (please find it at enter link description here in R 3.3.1 installed on the Windows 7. The script is started with the below line:
#!/usr/bin/env Rscript
When I type cuffdiff_gtf_attributes in R, it says Error: object 'cuffdiff_gtf_attributes' not found. Also, I tried Rscript cuffdiff_gtf_attributes that returned me: Error: unexpected symbol in "Rscript cuffdiff_gtf_attributes".
Moreover, I tried source('cuffdiff_gtf_attributes.R')that seems to work and returned the usage of the script as bellow
Error:
usage: cuffdiff_gtf_attributes --input=<inputGTF> [--output=outputGTF] | --help
But, when I add the arguments as source('cuffdiff_gtf_attributes.R') --input=file.gtf, it says that: Error: object 'file.gtf' not found. I also tried this command as source('cuffdiff_gtf_attributes.R') --input file.gtf, it says that Error: unexpected symbol in "source('cuffdiff_gtf_attributes.R') --input file.gtf"
Sorry, I couldn't post a sample GTF file, you can find a short sample of it at enter link description here
Everything is the current path. Could you please help me out to execute the script?
Thanks in advance
This is a script file. You should run using Rscript instead for Rgui.exe. From a command prompt, navigate to the directory where file.gtf is and run:
"%Programfiles%\R\R-3.3.3\bin\Rscript" cuffdiff_gtf_attributes.R --input=file.gtf

Symfony Console Output

I am writing my first symfony console apps and I would like to ask a question regarding the console outputs.
When I run a new CLI app in the console like: ./testapp then I get the following output:
Usage:
command [options] [arguments]
Options:
--help (-h) Display this help message
--quiet (-q) Do not output any message
--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
--version (-V) Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
--no-interaction (-n) Do not ask any interactive question
Available commands:
help Displays help for a command
list Lists commands
Is there a way to remove the display of this content? I want only the "Available Commands" to be visible. And is it possible to create my own groups in this display?
As of Symfony 2.5, you can change the default command (the command that's executed when no command name was specified). See for more information: http://symfony.com/doc/current/components/console/changing_default_command.html
The Console component will always run the ListCommand when no command name is passed. In order to change the default command you just need to pass the command name to the setDefaultCommand method.
(Symfony Console 4.1)
It's possible to remove the default options:
$options = $app->getDefinition()->getOptions();
unset($options['ansi']);
unset($options['no-interaction']);
unset($options['verbose']);
unset($options['help']);
unset($options['quiet']);
unset($options['version']);
unset($options['no-ansi']);
$app->getDefinition()->setOptions($options);
or just:
$app->getDefinition()->setOptions();
Options group will not show in the list command.
Although I don't know if this has any undesirable side effect.

Time stamping output files throws error for report

call pybot --timestampoutputs --log mylog.html --report NONE tests.html
[ ERROR ] Parsing 'tests.html' failed: Data source does not exist.
I want to create report with time stamp but throws error. Any example as how to generate reports with unique name with time-date.
The error you report, "Data source does not exist", is not because of your use of the --timestampoutputs option. It's because robot can't find "tests.html".
--timestampoutputs works fine when you give it a valid test suite. For example, when I ran the code in your question I ended up with a log file named mylog-20150220-053904.html.

Resources