How to Print Console.Log to JUnitXmlReporter using protractor?

1.1k Views Asked by At

I am doing a protractor test. I want to print the messages i wrote inside the test using Console.Log("Message") to JUnitXmlReporter(the XML file). OR .... is ther anyway to create a custom Output files using protractor. I want to print a Data i fetched from the test to a File.

2

There are 2 best solutions below

1
g.y On

Have you tried:

https://github.com/larrymyers/jasmine-reporters

from their page:

JUnitXmlReporter - Report test results to a file in JUnit XML Report format.

NUnitXmlReporter - Report test results to a file in NUnit XML Report format.

you can also create a custom one:

http://jasmine.github.io/2.1/custom_reporter.html

hope it helps

0
AdityaReddy On

You can keep things simple. You dont need any custom reporters to write the console information to a file. Just use the terminal output redirecting operator.

protractor conf.js > consoleLog.log

To append

protractor conf.js >> consoleLog.log

Check here for more options