Site Loader
Auckland, New Zealand
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.exe.config or
    • 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. Thanks, Karthik KK

Post Author: Karthik kk

10 Replies to “Generating HTML report with Diagnostics in CUIT”

  1. Hi Kartik,
    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

    1. Free edition will not have visual studio coded ui support, hence I dont think it will have one.

      Karthik KK

  2. Hi Karthik,

    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.

  3. Application Configuration File template is not there in Visual C#item.

    Could you please tell me how can i get that file.?

Leave a Reply

Your email address will not be published. Required fields are marked *