Hi Experts,Today I want to initiate discussion on "Keywords Performance Metrics Report" in robot framework.I have assigned to track duration took by each keyword (userdefined) in my automation suite. Its something wearied to get duration of each keyword in automation execution report (expand each & every test, keyword and note down its duration from log).So I made a report which gives us a metrics of each keyword used in automation suite.I named it as "Keywords Performance Metrics Report"How it Works:
- Uses simple python code to read output.xml file (which will be created after script execution)
- Get Test Case Name, Keyword Name, Start Time, End Time values from output.xml file
- Convert data to html report using Beautifulsoap (Table format with sorting capability)
How to use in project:
- Checkout the project
- Copy keyword_performance_metrics_report_creator.py and keyword_performance_metrics_executer.bat files to project (where output.xml file is available)
- Install beautifulsoap: pip install beautifulsoup4 (to create html report)
- Install lxml: pip install lxml (to read data from xml file)
- Execute keyword_performance_metrics_executer.bat file
- "Keywords Performance Metrics Report" will be opened in new chrome tab
Intention of sharing this project is to help the guys who are monitoring there keywords performance
- Checkout the project. Git: https://github.com/adiralashiva8/RFKeywordPerformanceMetrics
- Try within your project.
- Suggest your feedback/queries
- Lets improve this report together
I want to check this report with large automation suites (50 + test cases). To verify how the report behaves? and how sorting works?
Thanks for your feedback Mantri, Hope you loved it.FYI:1. I have fixed to show graphs on page load and now change is available in repo (star repo to get updates)2. This is completely a post processing report generation using output.xml. I will take a look into possibilities of launching report after execution3. Regarding Jenkins, show report after execution - You can include rf_metrics_executer .sh in jenkins which should process report after execution like (Run Suite && Execute rf_metrics_executer .sh)Please correct me if I'm wrongThanks,Shiva
#!/usr/bin/env pythons
from robot.api import ExecutionResult, ResultVisitor
class KeywordMetrics(ResultVisitor):
def start_keyword(self, kw): print str(kw.parent) + "\t" + str(kw.kwname)
result = ExecutionResult("output.xml")metrics = result.visit(KeywordMetrics())TC-001 Launch Chrome Browsercommon.Launch Chrome Browser Open Browsercommon.Launch Chrome Browser Wait Until Element Is VisibleSeleniumLibrary.Wait Until Element Is Visible Capture Page ScreenshotTC-002 Launch Chrome Browser> To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
>> > 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 https://groups.google.com/group/robotframework-users.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Agile Tester/Developer/Consultant :: http://eliga.fi
>> Lead Developer of Robot Framework :: http://robotframework.org
>
> --
> 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.
Thanks,Shiva Adirala
>> > To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.
>> > To post to this group, send email to robotframe...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/robotframework-users.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Agile Tester/Developer/Consultant :: http://eliga.fi
>> Lead Developer of Robot Framework :: http://robotframework.org
>
> --
> 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+unsubscrib...@googlegroups.com.
> To post to this group, send email to robotframe...@googlegroups.com.
> Visit this group at https://groups.google.com/group/robotframework-users.
> For more options, visit https://groups.google.com/d/optout.
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org
--
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.
To post to this group, send email to robotframework-users@googlegroups.com.
kind regards Ruud
Op zaterdag 28 juli 2018 20:16:48 UTC+2 schreef Shiva Prasad Adirala:
Hi Experts,Today I want to initiate discussion on "Keywords Performance Metrics Report" in robot framework.I have assigned to track duration took by each keyword (userdefined) in my automation suite. Its something wearied to get duration of each keyword in automation execution report (expand each & every test, keyword and note down its duration from log).So I made a report which gives us a metrics of each keyword used in automation suite.I named it as "Keywords Performance Metrics Report"How it Works:
- Uses simple python code to read output.xml file (which will be created after script execution)
- Get Test Case Name, Keyword Name, Start Time, End Time values from output.xml file
- Convert data to html report using Beautifulsoap (Table format with sorting capability)
How to use in project:
- Checkout the project
- Copy keyword_performance_metrics_report_creator.py and keyword_performance_metrics_executer.bat files to project (where output.xml file is available)
- Install beautifulsoap: pip install beautifulsoup4 (to create html report)
- Install lxml: pip install lxml (to read data from xml file)
- Execute keyword_performance_metrics_executer.bat file
- "Keywords Performance Metrics Report" will be opened in new chrome tab
Intention of sharing this project is to help the guys who are monitoring there keywords performance
- Checkout the project. Git: https://github.com/adiralashiva8/RFKeywordPerformanceMetrics
- Try within your project.
- Suggest your feedback/queries
- Lets improve this report together
I want to check this report with large automation suites (50 + test cases). To verify how the report behaves? and how sorting works?
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To post to this group, send email to robotframe...@googlegroups.com.
Prasad,Requested change(show suite metrics) is now available in Metrics Report. Please pull the latest changes and share your feedback.
I will suggest to star the repo to get latest updates
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
--
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.
To post to this group, send email to robotframework-users@googlegroups.com.
- Use git for request feature, create issue and feedback
- Star project to appreciate
Shiva
--
You received this message because you are subscribed to a topic in the Google Groups "robotframework-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/robotframework-users/orPiav7QNDM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
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 unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
python rf_metrics_report_creator.py
Added new feature to generate email (.eml) with statistics in tabular format.Intention: Help the guys one who wants to share there metrics. Following is the screenshot. Have a try
--
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.
Awesome feature Shiva. Where is it documented to setup the send to and send from email addresses?
On Fri, Sep 7, 2018 at 4:17 AM Shiva Prasad Adirala <adiral...@gmail.com> wrote:
Added new feature to generate email (.eml) with statistics in tabular format.--Intention: Help the guys one who wants to share there metrics. Following is the screenshot. Have a try
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.
Hi RF Users,I want to know feedback | suggestions | queries to improve and make robotframework-metrics report to be useful for project.I feel it's not the right channel to ask for robotframework-metrics feedback. But I dont have another option for it. Please send out email on your feedback.
--
You received this message because you are subscribed to a topic in the Google Groups "robotframework-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/robotframework-users/orPiav7QNDM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to robotframework-u...@googlegroups.com.
Hi RF Users,
I want to know feedback | suggestions | queries to improve and make robotframework-metrics report to be useful for project.I feel it's not the right channel to ask for robotframework-metrics feedback. But I dont have another option for it. Please send out email on your feedback.
--
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.
Shiva,One more thing I noticed which could be useful. If I have many XML files (small suite files with few test cases each), how can i use the tool to get the combined statistics of the whole project with many output.xml files?I tried using rebot to merge the output but it can not merge the output from 2 different suite filesThanks,Prasad.
On Tue, Sep 18, 2018 at 6:50 PM prasad ozarkar <pozark...@gmail.com> wrote:
Hi Shiva, Very useful report. I have a suggestion.. can you try to include stats about keyword reuse? I mean have a screen where we can see a list of (table) keywords and ranking based on reuse within the test cases/test suite.Thanks for your hard work on this.Prasad
On Tue, Sep 18, 2018 at 2:30 PM Shiva Prasad Adirala <adiral...@gmail.com> wrote:
Hi RF Users,--I want to know feedback | suggestions | queries to improve and make robotframework-metrics report to be useful for project.I feel it's not the right channel to ask for robotframework-metrics feedback. But I dont have another option for it. Please send out email on your feedback.Thanks for using robotframework-metricsRegards,Shiva
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.
Traceback (most recent call last): File "C:\development\robot-scripts\NIR\Results\rf_metrics_report_creator.py", line 36, in <module> result = ExecutionResult(output_file)NameError: name 'output_file' is not defined
Process finished with exit code 0
Shiva,One more thing I noticed which could be useful. If I have many XML files (small suite files with few test cases each), how can i use the tool to get the combined statistics of the whole project with many output.xml files?I tried using rebot to merge the output but it can not merge the output from 2 different suite filesThanks,Prasad.
On Tue, Sep 18, 2018 at 6:50 PM prasad ozarkar <pozark...@gmail.com> wrote:
Hi Shiva, Very useful report. I have a suggestion.. can you try to include stats about keyword reuse? I mean have a screen where we can see a list of (table) keywords and ranking based on reuse within the test cases/test suite.Thanks for your hard work on this.Prasad
On Tue, Sep 18, 2018 at 2:30 PM Shiva Prasad Adirala <adiral...@gmail.com> wrote:
Hi RF Users,--I want to know feedback | suggestions | queries to improve and make robotframework-metrics report to be useful for project.I feel it's not the right channel to ask for robotframework-metrics feedback. But I dont have another option for it. Please send out email on your feedback.Thanks for using robotframework-metricsRegards,Shiva
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.
On Monday, August 20, 2018 at 11:42:25 PM UTC+5:30, Shiva Prasad Adirala wrote:Awesome, Thanks a lot Pekke it worked as you mentioned.I have modified report and following are the screenshots of report. Guys feel free to use in your projects.DashboardTest Metrics: (same statistics as result.html)Keyword MetricsThanks,Shiva AdiralaRF Metrics Report
On Monday, August 20, 2018 at 7:09:34 PM UTC+5:30, Pekka Klärck wrote:Hi,
Great to hear that using the result API works fine. I don't think
keyword objects have a direct access to the test they are part of, and
in fact keywords used in suite setups/teardowns are not part of any
test. You could look at `kw.parent`, its parent, and so on until you
find a TestCase (or TestSuite) object, but when you are already using
the visitor interface it's easier to use `start_test`:
class KeywordMetrics(ResultVisitor):
def __init__(self):
self.test = None
def start_test(self, test):
self.test = test
def end_test(self, test):
self.test = None
def start_keyword(self, kw):
test_name = self.test.name if self.test is not None else ''
print '%s\t%s' % test_name, kw.name)
Cheers,
.peke
la 18. elok. 2018 klo 10.16 Shiva Prasad Adirala
(adiral...@gmail.com) kirjoitti:
>
> Hi Peke,
>
> As per your suggestion I tried to use robot framework api instead of parsing output.xml using lxml. I like the Performance of fetching results :)
>
> Currently I'm modifying Robot framework Metrics report to use robot framework api. During this I got strucked in Keyword Metrics report generation
>
> Problem: I want to show TestCase_Name and Keyword_Name in report for all types of keywords (user defined or library). When I use kw.parent it returns immediate parent for library keywords but I want test case name
>
> Reference: robot.result.model.Keyword
>
> My Code
>
> #!/usr/bin/env pythons
>
> from robot.api import ExecutionResult, ResultVisitor
>
> class KeywordMetrics(ResultVisitor):
>
> def start_keyword(self, kw):
> print str(kw.parent) + "\t" + str(kw.kwname)
>
> result = ExecutionResult("output.xml")
> metrics = result.visit(KeywordMetrics())
>
> Ouput
> TC-001 Launch Chrome Browser
> common.Launch Chrome Browser Open Browser
> common.Launch Chrome Browser Wait Until Element Is Visible
> SeleniumLibrary.Wait Until Element Is Visible Capture Page Screenshot
> TC-002 Launch Chrome Browser
>
> Note: I have used kw.parent.parent but I feel its not the right way to acheive
>
> Question: Is there any posibility to get TestCase_Name using keyword object. Please suggest if I need to perform this in different way
>
> On Tuesday, August 7, 2018 at 9:55:13 PM UTC+5:30, Pekka Klärck wrote:
>>
>> Hi,
>>
>> This looks like a useful tool. I don't have feature ideas, but I have
>> some comments about the implementation:
>>
>> - Instead of parsing output.xml using lxml, you could consider using
>> Robot's result modules. It has a simple API and being highly optimized
>> is likely also faster and more memory efficient. For more details see
>> the API docs at
>> http://robot-framework.readthedocs.io/en/v3.0.4/autodoc/robot.result.html
>>
>> - I would consider using a template engine like Jinja
>> (http://jinja.pocoo.org/) for constructing HTML report.
>>
>> Cheers,
>> .peke
>> la 28. heinäk. 2018 klo 21.16 Shiva Prasad Adirala
>> (adiral...@gmail.com) kirjoitti:
>> >
>> > Hi Experts,
>> >
>> > Today I want to initiate discussion on "Keywords Performance Metrics Report" in robot framework.
>> >
>> > I have assigned to track duration took by each keyword (userdefined) in my automation suite. Its something wearied to get duration of each keyword in automation execution report (expand each & every test, keyword and note down its duration from log).
>> >
>> > So I made a report which gives us a metrics of each keyword used in automation suite.
>> >
>> > I named it as "Keywords Performance Metrics Report"
>> >
>> > How it Works:
>> >
>> > Uses simple python code to read output.xml file (which will be created after script execution)
>> > Get Test Case Name, Keyword Name, Start Time, End Time values from output.xml file
>> > Convert data to html report using Beautifulsoap (Table format with sorting capability)
>> >
>> >
>> > How to use in project:
>> >
>> > Checkout the project
>> > Copy keyword_performance_metrics_report_creator.py and keyword_performance_metrics_executer.bat files to project (where output.xml file is available)
>> > Install beautifulsoap: pip install beautifulsoup4 (to create html report)
>> > Install lxml: pip install lxml (to read data from xml file)
>> > Execute keyword_performance_metrics_executer.bat file
>> > "Keywords Performance Metrics Report" will be opened in new chrome tab
>> >
>> >
>> > Intention of sharing this project is to help the guys who are monitoring there keywords performance
>> >
>> > Checkout the project. Git: https://github.com/adiralashiva8/RFKeywordPerformanceMetrics
>> > Try within your project.
>> > Suggest your feedback/queries
>> > Lets improve this report together
>> >
>> >
>> >> I want to check this report with large automation suites (50 + test cases). To verify how the report behaves? and how sorting works?
>> >
>> > --
>> > 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 https://groups.google.com/group/robotframework-users.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Agile Tester/Developer/Consultant :: http://eliga.fi
>> Lead Developer of Robot Framework :: http://robotframework.org
>
> --
> 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 https://groups.google.com/group/robotframework-users.
> For more options, visit https://groups.google.com/d/optout.
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org
--
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.
--
That `generated_by_robot` ought to be what you need if you are interested in is the output.xml created by Robot or Rebot.Environment specific information needs to first be captured and stored somehow. There's no generic solution for that.Sent from my mobile.
23.9.2018 20.45 "Shiva Prasad Adirala" <adiral...@gmail.com> kirjoitti:
Thanks Pekke,--
- I got the total suite elapsed time with ExecutionResult object: ExecutionResult('output.xml').suite.elapsedtime
- I tried to get generator, generated attribute values of robot tag by using ExecutionResult object like ExecutionResult('output.xml').generated_by_robot but it returns boolean value.
Could you please help me with example for point 2?One more query: Is it possible to get more information of test execution like which browser test got executed, browser version, OS, OS version (windows7, windows10 instead of win32) etc., info using robotframework api. If yes could you please guide to get info-Shiva
On Sunday, September 23, 2018 at 8:53:36 PM UTC+5:30, Pekka Klärck wrote:You use the `robot.api.ExecutionResult`, right? The created result object ought to haveat least the generator information available. If it doesn't have execution times, you can get them from the suite it contains.Sent from my mobile.su 23. syysk. 2018 klo 17.59 Shiva Prasad Adirala <adiral...@gmail.com> kirjoitti:Hi Pekke,
- I want to show Generator, Generated value in my report. I tried to get <robot> tag using XmlElementHandler but no luck. Could you please help me on that
- Is there any option in api to get entire execution time so I can display execution time in report (same as report.html)
Thanks in advance
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.
--
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.
Hi Experts,Today I want to initiate discussion on "Keywords Performance Metrics Report" in robot framework.I have assigned to track duration took by each keyword (userdefined) in my automation suite. Its something wearied to get duration of each keyword in automation execution report (expand each & every test, keyword and note down its duration from log).So I made a report which gives us a metrics of each keyword used in automation suite.I named it as "Keywords Performance Metrics Report"How it Works:
- Uses simple python code to read output.xml file (which will be created after script execution)
- Get Test Case Name, Keyword Name, Start Time, End Time values from output.xml file
- Convert data to html report using Beautifulsoap (Table format with sorting capability)
How to use in project:
- Checkout the project
- Copy keyword_performance_metrics_report_creator.py and keyword_performance_metrics_executer.bat files to project (where output.xml file is available)
- Install beautifulsoap: pip install beautifulsoup4 (to create html report)
- Install lxml: pip install lxml (to read data from xml file)
- Execute keyword_performance_metrics_executer.bat file
- "Keywords Performance Metrics Report" will be opened in new chrome tab
Thanks,Shiva Adirala
la 18. elok. 2018 klo 10.16 Shiva Prasad Adirala
(adiral...@gmail.com) kirjoitti:
>
>> la 28. heinäk. 2018 klo 21.16 Shiva Prasad Adirala
>> (adiral...@gmail.com) kirjoitti:
>> >
>> > Hi Experts,
>> >
>> > Today I want to initiate discussion on "Keywords Performance Metrics Report" in robot framework.
>> >
>> > I have assigned to track duration took by each keyword (userdefined) in my automation suite. Its something wearied to get duration of each keyword in automation execution report (expand each & every test, keyword and note down its duration from log).
>> >
>> > So I made a report which gives us a metrics of each keyword used in automation suite.
>> >
>> > I named it as "Keywords Performance Metrics Report"
>> >
>> > How it Works:
>> >
>> > Uses simple python code to read output.xml file (which will be created after script execution)
>> > Get Test Case Name, Keyword Name, Start Time, End Time values from output.xml file
>> > Convert data to html report using Beautifulsoap (Table format with sorting capability)
>> >
>> >
>> > How to use in project:
>> >
>> > Checkout the project
>> > Copy keyword_performance_metrics_report_creator.py and keyword_performance_metrics_executer.bat files to project (where output.xml file is available)
>> > Install beautifulsoap: pip install beautifulsoup4 (to create html report)
>> > Install lxml: pip install lxml (to read data from xml file)
>> > Execute keyword_performance_metrics_executer.bat file
>> > "Keywords Performance Metrics Report" will be opened in new chrome tab
>> >
>> >
>> > Intention of sharing this project is to help the guys who are monitoring there keywords performance
>> >
>> > Checkout the project. Git: https://github.com/adiralashiva8/RFKeywordPerformanceMetrics
>> > Try within your project.
>> > Suggest your feedback/queries
>> > Lets improve this report together
>> >
>> >
>> >> I want to check this report with large automation suites (50 + test cases). To verify how the report behaves? and how sorting works?
>> >
>> > --
>> > 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.
>> > To post to this group, send email to robotframe...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/robotframework-users.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Agile Tester/Developer/Consultant :: http://eliga.fi
>> Lead Developer of Robot Framework :: http://robotframework.org
>
> --
> 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.
> To post to this group, send email to robotframe...@googlegroups.com.
> Visit this group at https://groups.google.com/group/robotframework-users.
> For more options, visit https://groups.google.com/d/optout.