Robot framework logs producing duplicate output when used with Unicon - robotframework

Hi I'm using robot framework with python specifically the unicon(https://pypi.org/project/unicon/) package. When using unicon without robot I do not get duplicate output in the stdout but when using unicon with robot in the logs I get duplicate output. I'm not quite sure what is causing this. The code is exactly the same. I'm not sending commands twice.
Expected each command to appear in the log once as evident in the stdout.
https://i.ibb.co/YBpnSg6/unicon-stdout-output.png
Results from log output:
https://i.ibb.co/K59PjQ2/duplicate-output-robot.png

Related

How to send prints of R commands to the log

The question might be unclear -sorry about that- but is pretty simple.
I'm currently writing a Rscript for which I'd like to send all the terminal's outputs to a log file, using the logr package, without using any redirection with >.
However, I have issues to redirect to the log file all the various statements that print to the console by the R commands of an other package (which is dada2).
For example, when I use a command of dada2, it prints some various informations to the console while computing its stuff, but these informations are not in the final log file.
Is there a way to correct this or should I use an other package or a simple redirection with >?
Thanks.

how to verify the syntax of Robot framework code

I have robot framework written in Linux OS. I often get syntax issue in my ROBOT FRAMEWORK code.
Do we have any online compiler or in python to trace where the syntax error is occurring(Which line)?
You can use the --dryrun command line argument to check test data validity and syntax.
From the user guide which I strongly suggest to browse in general.
Robot Framework supports so called dry run mode where the tests are run normally otherwise, but the keywords coming from the test libraries are not executed at all. The dry run mode can be used to validate the test data; if the dry run passes, the data should be syntactically correct. This mode is triggered using option --dryrun.
The dry run execution may fail for following reasons:
Using keywords that are not found.
Using keywords with wrong number of arguments.
Using user keywords that have invalid syntax.

How to stop Robot Framework suite execution on console error?

Robot framework may show some errors to the console if e.g. it cannot find some file at some path. This is not test or suite related failures. This error just loggs to the console, but Robot Framework continues to execute suites and test after this kind of error. So my question is: how can I change this default behavior and tell Robot Framework to stop execution if it finds this kind of errors?
Maybe it can be some command line option or special tag. I searched in docs here https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#errors-and-warnings and did not find any info about that. Am I missing something?
Example of such error:
[ ERROR ] Error in file 'D:\Projects\project\suites\02__app\05__d\editing.robot': Resource file '..\..\..\resources\keywords\attribute.resource' does not exist.
Suites.App.d.Editing
I believe the option --exitonerror is the command line option you are looking for.

Commandline option for robot framework to get console output instead of get output logs

How to get robot framework running output in console instead of logs by using command line option?
There is no such option.
You might be able to create something with the listener interface, hooking up at suite/case/keyword level and getting the current output, printing to console filtered info.
Have in mind the logging is excessive - look at a sample output.xml, having that much information in the console may be overwhelming.

Is there a way to monitor test log for error string using robot framework?

I am a newbie to robot framework, I just wanted to know if i can monitor my application log for a certain keyword i.e. FAIL, If i find the message i stop test and report failure.
It seems to me that the standard keyword Grep File might be appropriate. In the built in Operating System Library documentation you can find more details. In this SO Answer an example is given.

Resources