Writing Custom HTML Logs
Asked Answered
C

2

12

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...

Colbert answered 8/8, 2013 at 15:27 Comment(5)
I asked this question before but only got redirected to a question where a guy made his own logs, Hope we get a good answer.Narrative
have you posted this on the msdn forumsNarrative
@Narrative No, not yet.Colbert
@StickFigs - deleted my answer after I realized I wasn't really answering your question. Perhaps you could look into CUITe? cuite.codeplex.comRatib
@Ratib I already am using CUITe and I don't think it has anything to do with the HTML log.Colbert
L
1

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.”

Lyallpur answered 30/8, 2013 at 9:8 Comment(0)
G
0

We're currently evaluating what sort of logging we want and it doesn't sound like there's a lot of options.

this.TestContext.WriteLine("Some logging stuff");

  • This only goes to the standard output of the test, under the TestContext Messages header. Unfortunately, it doesn't go into the UITestActionLog.html, which is the question asked above.

It sounds like, based on these two links, there is not a way to do this easily out of the box: http://social.msdn.microsoft.com/Forums/vstudio/en-US/4c9b11bc-e1a6-4024-928f-c4ceb849fec3/how-to-edit-coded-ui-log-fileuitestactionloghtml-for-customizing-the-log-details?forum=vstest http://social.msdn.microsoft.com/Forums/vstudio/en-US/a53ddcf4-11f7-4586-8256-c4e238dc192a/is-it-possible-to-write-message-into-uitestactionlog?forum=vstest

You could use this to find the log file, and then write your own logger to append to that: How to get path to UITestActionLog.html from code

Glazer answered 30/9, 2014 at 12:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.