I want the output of my protractor test reports in excel, right now its generating in HTML format. They are also generating in XML format. Any idea will be helpful and will be appreciated. Thank you.
-
Currently no excel reports are generated by protractor or any other supported library of node js .... Any reason u want excel report ? Stiff job but you can read xml and write to xls file same data which you get from allure report – Amit Jain Aug 31 '18 at 11:40
-
@Amit Thank you for replying. Actually i want to send this excel through email. Any word document will also work but not HTML or XML. I can work with reading xml and writing into excel as well however i have no idea,how to do it. If you can help me with it? – Shruti Aug 31 '18 at 13:30
-
You create the problem by yourself. You can create a very beautiful report using for example Allure 2 https://docs.qameta.io/allure/#_jasmine , and send (if you strongly want) just a link to current report by email. – Oleksii Sep 02 '18 at 17:17
1 Answers
What you are looking for is a karma reporter that will report the tests in an excel format and send an email with the results. Unfortunately, none exist, so you will have to create one yourself.
Fortunately, creating a karma reporter is easy, there exists many libraries that can generate excel files, and sending an email is easy with the nodemailer package.
First, creating a karma reporter, you can use the karma-growl-reporter as an example.
Second, the excel4node plugin seems to be fairly well maintained and feature-rich (I have not used it myself, so I can't exactly vouch for it).
Third, I already mentioned nodemailer, which can send an email with the results.
With these three pieces, it should be fairly straightforward to implement the reporter, but feel free to comment if you have any questions.

- 28,387
- 9
- 92
- 148
-
Thank you @Andrew Eisenberg for the solution. I have one question, can we use excel4node with jasmine html reporter? – Shruti Sep 03 '18 at 07:54
-
As i googled, i got to know that we can create reports in xml as well and then we can read it and write it in excel. what you guys think? but i want to know, how to read xml in protractor – Shruti Sep 03 '18 at 09:52
-
There's no reason why you *can't* use excel4node in a jasmine reporter. The reporter just runs as part of a node process and you can do anything you need to in there. It might be easier to read and write xml than excel. You can use something like https://www.npmjs.com/package/xmlbuilder to build your xml document. – Andrew Eisenberg Sep 03 '18 at 16:40