How to see logs of running robot script? - robotframework

The robot scripts when ran on RIDE, generate output.xml, report.html etc files, once run is over.
Is there any way available to view logs when script is still running? (When I use pause on failure)
Also some times I had to Stop/Abort the run in middle, and no logs are generated in such cases.
Kindly help,
Thanks in advance

As for first part — RIDE runs tests adding own listener, providing more verboseness of the output and pausing/resuming functionality.The easiest thing is to run tests not from RIDE, but from console using robot/pybot script. In this case much less logs are written to output (though it doesn't provide pause/resume functionality).
For second part — robot (RIDE starts robot script — you can see it in execution log: command: pybot.bat...) generates output.xml file not after but during execution, so generated output.xml is not valid until test is finished. After normal execution rebot tool generating log.html automatically. So generally it's possible to take following steps:
"Fix" your incomplete output.xml file after execution stop with fixml. output.xml location for RIDE execution can be found in the very same execution log of yours (e.g. ...\appdata\local\temp\RIDEv_0yrp.d\ in my case)
Run rebot stand-alone: rebot output.xml --log log.html --report report.html. Rebot options description you can check using rebot --help (as usual)
Please also note that directory where RIDE output files are stored is temporary — exists only when RIDE is started. You will lose your output on exiting RIDE
I'm using RIDE 1.5 so maybe my answer is not valid for other versions

In RIDE, under Run Tab , when you are running the scripts , you have a option, show message log, it will shows the runtime log.
Try this out.

Related

Why is phpunit still masking test output?

I have some tests that are passing locally but failing in CI. I'm trying to troubleshoot using the command php ./vendor/bin/phpunit -d memory_limit=512m --debug --verbose however no amount of var_dump(), throwing exceptions or anything will give me any debug output. I know it's the output buffer hiding the output. I've looked at phpunit's --help and don't see anymore flags I could possibly add that will show me the output. Looking at the TestCase source code I'm not seeing a clear way to turn off this buffering. I'm also confused why locally I do see the debug output...

How do you run tests in parallel using robot framework? Issues with Parallel Library

The below is the code present in parallel_tests.txt
*** Settings ***
Library Parallel
*** Test Cases ***
Runner
Run Parallel Tests Hello World
Hello
[Tags] parallel
Log Hello123
World
[Tags] parallel
Log World123
I am trying to execute this test case file
from terminal using jybot as below:
jybot parallel_tests.txt;
I am getting the following error:
No keyword with name 'Run Parallel Tests' found.
How to execute both test cases Hello and World ,in parallel in robot framework using parallel library.
Slightly different use case but have you tried using pabot?
I haven't gone down the rabbit hole with this one so don't have an in-depth understanding but I do use it for cross-browser tests via sauceLabs. It will work differently from how you want in that it does parallel runs but by test suite rather than test case level. Perhaps this is configurable? Unfortunately as mentioned I just know enough to get it working for my needs and haven't done a deep dive.
Any questions let me know and I'll try to help.
Here's a quick example as requested, I've stripped lots of our stuff which is useless in your case but left some in so you can see how to build up. I changed the processes parameter from %processes% to 2, the end result is the same, in my case these values are coming from a teamcity build configuration:
pabot --processes 2 --variable environment:%environment% --name OS_X_10.9-Firefox --variable browser:%browser% --listener robot-tc-listener --include %includetags% --exclude %exclusiontags% --outputdir %PabotResults_DIR% --output output.xml --report report.html --log log.html tests
Which version of RobotFramework are you using? The Parallel library was removed in 2.5 (see this ticket, though there may be distant plans of reintroducing it).
I tried to reproduce your issue using this file with RF version 2.8, but there are several compatibility problems, as expected.
Are you sure that the library has been loaded properly? When it fails, in addition to the error, you will also get a message telling you that the keywords are unavailable.

Cant run Shell script in Oozie using Hue

I am trying to run shell script in Oozie using Hue. However it is not running and give exception.
My Shell script file:
#! /bin/bash
hive -e 'desc emptable;'
=======================================
Also added same script file in FILE option in script action.
=======================================
Gives exceptions:
Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]
=========================================
I also tried with hive-site file, added in FILE option. but not worked.
Oozie has a specific Hive action, and for a good reason: on a standard Hadoop setup, Hive/Pig/whatever are not installed on the "slave" nodes.
I suggest that you read some documentation on your own.
You should check the logs of the action on the graph of the workflow dashboard page, it should print what really happened.
In the latest Hue, there is even an HiveServer2 action.

cron job not creating logs

I am trying to execute some sql statements using an unix script. The script is placed in crontab to run everyday at 12.00 midnight and get the output in a log file.
Though my script is running and I can see the changes in DB but the log file is not generating. However manually running the script is generating the log file. Please suggest a solution.
now=`date "+%d%m%y"`
LOG="table_partition_$now.log"
test=`sqlplus -s ${USER}/${CPWD}#${DB} << THEEND > $LOG
...
...
...
exit
This is my code snippet. Please suggest
sqlplus has no closing `
Also, can you say whether the script runs correctly outside of cron? If it only fails in cron, you may want to call
env > /tmp/mylatestslog.txt
at the start and compare the differences with your local environment. (May be differences in the user, or variables used from you personal .bashrc).
(PS. also edited the question to show one command per line.)

How to run a windmill test script

I have recorded some interactions with windmill and when I hit save I get the following (python) script:
# Generated by the windmill services transformer
from windmill.authoring import WindmillTestClient
def test_recordingSuite0():
client = WindmillTestClient(__name__)
client.type(text=u'Hello World', id=u'lst-ib')
client.click(link=u'Hello world program - Wikipedia, the free encyclopedia')
client.waits.forPageLoad(timeout=u'20000')
Now I don't have any clue how to run this. At the end I need a script with which I can run 100 tests at the same time.
However, if I get one test running and it is easy to parallelize it with python. But right now I can't run this simple test.
I hope someone can help me :).
You simply run by pasting the output script from windmill into a file named as *.py and then you execute the following command
windmill chrome test=./[directory containing your *.py files] http://www.google.com
You can also specify directly the name of the test file.
If you want to run the script in parallel, then you can just execute those commands in separate terminals. This works so far only with chrome. Firefox is complaining if there more than one instance open.

Resources