How to get the test coverage

2,862 views
Skip to first unread message

Shree

unread,
Dec 20, 2013, 6:01:00 AM12/20/13
to robotframe...@googlegroups.com
Hi,

I am using Robot framework for API automation using python.
I have written all the keywords using python and test cases are written using robot syntax i.e in ext file.
(All python keywords are called in test.txt file.)

Now, the question is I want to check the test coverage for all the test case .But, I am not able to do that.

Can anyone plz tell that how to take the test coverage in robot framework where keywords are written in Python

Note: I run my test cases from command prompt like :
pybot test.txt

Thanks,
Shree

Pekka Klärck

unread,
Dec 20, 2013, 2:07:09 PM12/20/13
to bhoyar.bh...@gmail.com, robotframework-users
2013/12/20 Shree <bhoyar.bh...@gmail.com>:
>
> Can anyone plz tell that how to take the test coverage in robot framework
> where keywords are written in Python

What do you mean with test coverage? If you mean something like how
many features of your application are tested, that's impossible to
tell just based on executed tests. If you mean how big portion of your
application code is tested, or at least executed when running tests,
you need to look at coverage tools that support the language your
application has been implemented with. The typical workflow with them
is that you first instrument your code, then execute tests, and
finally analyze the coverage results.

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

Harsh H Mehta

unread,
Mar 5, 2014, 6:02:34 PM3/5/14
to robotframe...@googlegroups.com
I tried using the 'coverage' tool by python, that can be found here https://pypi.python.org/pypi/coverage

I am still not sure how to interface this tool with Robot Framework to measure coverage by running tests that execute my python library code.

@Pekka,

Do you have any pointers on how this can be done?

Ed Manlove

unread,
Mar 5, 2014, 8:51:13 PM3/5/14
to robotframe...@googlegroups.com
I recently came across this post http://dmeio.blogspot.cz/2014/02/code-coverage-with-robotframework.html.  I've not read the article (just skimmed it) nor do I use Robot Framework in relation to code coverage so I am not qualified to speak on how useful this is. But it might be of use to you.

Ed
--
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/groups/opt_out.

Mukesh Kumar

unread,
Mar 6, 2014, 12:31:51 PM3/6/14
to devP...@verizon.net, robotframe...@googlegroups.com
Robot-framework has nothing to do with code coverage. 
You can separately hook the code coverage module for your software/web app and run the robot tests.
Then you can check percentage of code which has been executed while running your automated tests.
We use python coverage tool to monitor our code coverage while we run automated tests.

Thanks
Mukesh

sdkc...@gmail.com

unread,
Jul 15, 2015, 5:51:20 AM7/15/15
to robotframe...@googlegroups.com, devP...@verizon.net
Mukesh can you point us to some pointers how did you do this?

Rudev

unread,
Nov 20, 2016, 4:13:44 PM11/20/16
to robotframework-users, devP...@verizon.net
Any update on this ? Has any coverage method been enabled yet ? Can RobotFramework list the set of methods used as a keyword from external library in the robot Test ?

What I meant is: 
My library: 'sample.py', with X number of methods
Robot Test: 'sampletest.robot' utilizes 3 of the X methods from My library.

Can we list the name of those 3 utilized methods ?
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@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/groups/opt_out.

--
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-users+unsub...@googlegroups.com.

mic...@vsp.com

unread,
Feb 15, 2017, 12:59:29 AM2/15/17
to robotframework-users
Thank you! This was very helpful


On Wednesday, March 5, 2014 at 5:51:13 PM UTC-8, Ed Manlove wrote:
I recently came across this post http://dmeio.blogspot.cz/2014/02/code-coverage-with-robotframework.html.  I've not read the article (just skimmed it) nor do I use Robot Framework in relation to code coverage so I am not qualified to speak on how useful this is. But it might be of use to you.

Ed

On 03/05/2014 06:02 PM, Harsh H Mehta wrote:
I tried using the 'coverage' tool by python, that can be found here https://pypi.python.org/pypi/coverage

I am still not sure how to interface this tool with Robot Framework to measure coverage by running tests that execute my python library code.

@Pekka,

Do you have any pointers on how this can be done?

On Friday, December 20, 2013 6:01:00 AM UTC-5, Shree wrote:
Hi,

I am using Robot framework for API automation using python.
I have written all the keywords using python and test cases are written using robot syntax i.e in ext file.
(All python keywords are called in test.txt file.)

Now, the question is I want to check the test coverage for all the test case .But, I am not able to do that.

Can anyone plz tell that how to take the test coverage in robot framework where keywords are written in Python

Note: I run my test cases from command prompt like :
pybot test.txt

Thanks,
Shree
--
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-users+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages