Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing Custom HTML Logs

My Coded UI Test is configured so that the output of the test automatically produces an HTML log file, the instructions for doing this can be seen here.

Is there any way to customize this HTML log or make my own HTML logger so that mine is used to produce the log instead? For instance the default HTML log only shows Assert events if they fail. I would like Assert events to be shown even if they don't fail.

I would like to use the default HTML logger as a base as it already does almost exactly what I need, I'm not looking for a solution such as create my own output messages during the test then create an HTML file with these messages myself.

Update: It looks like the .html file is ultimately written by C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\QTAgent32_40.exe if that helps at all...

like image 373
Kyle V. Avatar asked Aug 08 '13 15:08

Kyle V.


People also ask

What should be configured to create a custom log file with a different log level?

To define a custom log level in code, use the Level. forName() method. This method creates a new level for the specified name. After a log level is defined you can log messages at this level by calling the Logger.


1 Answers

The instructions say:

With the modifications to the QTAgent32.exe.config file in place, when you run a coded UI test you will see there is an output link in the Test Explorer results. Log files are produced not only when your test fails, but also for successful tests when the trace level is set to “verbose.”

like image 74
JohnSurrey Avatar answered Oct 14 '22 15:10

JohnSurrey