In this post we will discuss working with Drawhighlight method as well as diagnostics in Coded UI testing to generate HTML report as shown below.
Visual debug during playback
In coded UI testing we can set the diagnostics information for our code and we can get more information about the underlying code execution.
This we can obtain using a method called
DrawHighlight This will show a rectangular red color box in the control.
Problem with DrawHighlight()
The DrawHighlight() method is, it takes 7 seconds to complete its action, which incurs a slow performance over the period of time in you code execution.
And hence considered as a bad practice.
Instead of DrawHighlight(), we can set Diagnostic levels.
This can be done by modifying the
QTAgent32_40.exe.config We can also add the same information of QTAgent into our project specific to app.config
The last option is by overriding the playback setting by adding the below LOC
Playback.PlaybackSettings.LoggerOverridestate = HtmlLoggerState.AllActionSnapshot;
Here is the complete video of the above discussion
Thanks for reading the post and watching the video !!!
Please leave your comments and let me know if there is anything I should update in this post.
10 Replies to “Generating HTML report with Diagnostics in CUIT”
We can set below mentioned settings for the HTML report, which will help to verify & validate the each automated step.
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\QTAgent32.exe
I cannot find the QTAgent32.exe file. I am using Visual Studio 2015 (free version).
Any suggestions ?
Free edition will not have visual studio coded ui support, hence I dont think it will have one.
What about if we run multiple scripts in one single go…
Can we change the folder name under Test Results folder with the testcase name. By defaults the folder is generated as “Shubham_S03_PUNITP152269L 2016-12-09 13_36_49” : machine name appended with date time. How to rename it with the testcase name. Please suggest.
Can we use this HTML report for Page Object Model.
Sampath kumar Mohan
Please upload video of Coded ui custom report generation.
You should probably look @this link https://github.com/executeautomation/ExecuteAutomationReportingSystem
Application Configuration File template is not there in Visual C#item.
Could you please tell me how can i get that file.?
How can we generate .txt file for CodedUI test logs?