are there any way to generate log and report.html for each test case during execution and keep on appending the ongoing execution results ?

1,984 views
Skip to first unread message

శంకర్ కుమార్ యల్లపు

unread,
Jul 13, 2015, 3:10:53 PM7/13/15
to robotframe...@googlegroups.com
Hi ,
I have a test suite contains more than hundred test cases,  I just want to generate reports for the each test case when it's finished.I am using m own library with some bunch of keywords. Please help me , waiting for the log till entire test  finishes eating my rework time.

Pekka Klärck

unread,
Jul 13, 2015, 4:50:16 PM7/13/15
to sankark...@gmail.com, robotframework-users
2015-07-13 14:32 GMT+03:00 శంకర్ కుమార్ యల్లపు <sankark...@gmail.com>:
> Hi ,
> I have a test suite contains more than hundred test cases, I just want to
> generate reports for the each test case when it's finished.

There is no built-in way to do this. Due to how logs and reports are
generated, implementing this would be a huge task.

> I am using m own
> library with some bunch of keywords. Please help me , waiting for the log
> till entire test finishes eating my rework time.

If the problem is that you'd like to see when a first test fails,
using --exitonfailure command line option might work for you. That is
especially nice with --dotted option provided by the forthcoming RF
2.9 and already available in the latest preview releases.

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

శంకర్ కుమార్ యల్లపు

unread,
Jul 14, 2015, 8:20:41 AM7/14/15
to robotframe...@googlegroups.com, sankark...@gmail.com
Hi peke,
Thanks for your clarification. 
But my problem is to just analyze the very instant when it failed with proper log messages, where my execution should not be paused or stopped.

I have a thought roaming in my head,please clarify me whether we can achieve this or not . when we have the data in output.xml for every step what we are doing on RF during the execution. so, can we generate the reports.hml and logs.html when RF moving from one test case to another during the execution. that would be helpful for quicker rework on failures.

Thanks & Regards,
Shankar

Bryan Oakley

unread,
Jul 14, 2015, 8:48:43 AM7/14/15
to sankark...@gmail.com, robotframework-users
Shankar:

Are you aware of the listener interface? You can have robot call a python function for every test event (suite start, suite end, keyword start, keyword end, test start, etc.). See http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#using-listener-interface

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

శంకర్ కుమార్ యల్లపు

unread,
Jul 15, 2015, 7:09:42 AM7/15/15
to robotframe...@googlegroups.com, sankark...@gmail.com
Hi,
I am aware Listener interface,Could you please tell me how to use listener  ? I have tried it but i am getting error like this "Importing test library 'RobotListener' failed: ImportError: No module named RobotListener"

You can find the code in the attachment,  I have tried keeping my listener in Robot library and mentioned in my test suite also.
RoboListener.py

Pekka Klärck

unread,
Jul 16, 2015, 7:06:20 PM7/16/15
to శంకర్ కుమార్ యల్లపు, robotframework-users
2015-07-14 15:20 GMT+03:00 శంకర్ కుమార్ యల్లపు <sankark...@gmail.com>:
>
> I have a thought roaming in my head,please clarify me whether we can achieve
> this or not . when we have the data in output.xml for every step what we are
> doing on RF during the execution. so, can we generate the reports.hml and
> logs.html when RF moving from one test case to another during the execution.
> that would be helpful for quicker rework on failures.

This would not be easy to implement. One problem is that because
output.xml is not flushed to disk (it would slow down execution), you
may not actually have all information written down yet. A bigger
problem is that Robot's design has been creating logs/reports after
execution, and changing that would be quite a bit of work. If someone
is interested to implement this, I can help explaining the current
design and can review pull requests.

An alternative solution would be creating a framework on top of Robot
that runs tests as separate smallish runs and allows generating
logs/reports once one such run ends. It could at the end combine
results with Rebot, and you would have also one big log/report with
all executed tests like you would get if you run them all in one run.

Dave Kipfer

unread,
Jul 31, 2015, 3:40:56 PM7/31/15
to robotframework-users, sankark...@gmail.com, pe...@iki.fi

On Thursday, July 16, 2015 at 7:06:20 PM UTC-4, Pekka Klärck wrote:
This would not be easy to implement. One problem is that because
output.xml is not flushed to disk (it would slow down execution), you
may not actually have all information written down yet. A bigger
problem is that Robot's design has been creating logs/reports after
execution, and changing that would be quite a bit of work. If someone
is interested to implement this, I can help explaining the current
design and can review pull requests.

An alternative solution would be creating a framework on top of Robot
that runs tests as separate smallish runs and allows generating
logs/reports once one such run ends. It could at the end combine
results with Rebot, and you would have also one big log/report with
all executed tests like you would get if you run them all in one run.
Something like this would be a nice-to-have in my situation.  I had thought that
two levels of Robot might do the job.  If a Suite listener on the top level would check
to see that it is encompassing test cases, then it could potentially start another
Robot which only runs that suite. 
 
I've already built an output merge tool so the mini-reports can be used to
build the full reports at the end..
 
But with Issue #1976 implemented in 2.9, does that mean that the Listener
has access to the in-memory report structure and would just need to wrap it
in a temporary Report object then serialize it?  Rebot could be spawned off
asynchronously as required once the output.xml has been created.
 
Would either of those ideas work?
 

Pekka Klärck

unread,
Jul 31, 2015, 5:44:52 PM7/31/15
to Dave Kipfer, robotframework-users, శంకర్ కుమార్ యల్లపు
2015-07-31 22:13 GMT+03:00 Dave Kipfer <davek...@gmail.com>:
>
> But with Issue #1976 implemented in 2.9, does that mean that the Listener
> has access to the in-memory report structure and would just need to wrap it
> in a temporary Report object then serialize it?

No. This information is passed to "pre-rebot modifier" after
execution. We have been discussing about a new listener API that would
get real result objects as arguments, though. I see plenty of cool use
cases for it and hope we have time to include it into RF 3.0:
https://github.com/robotframework/robotframework/issues/1208

JK

unread,
Dec 2, 2021, 3:22:20 PM12/2/21
to robotframework-users
Hi Pekka,

Do you confirm that it is still not possible to generate intermediate log file at the end of each test case ?

Best regards

Reply all
Reply to author
Forward
0 new messages