locked
How to enable code coverage in Coded-UI test RRS feed

  • Question

  • Hi, experts

    Is there any way that I can collect the code coverage information in a Coded-UI information?

    I tired first open the "code coverage" in Local.testsettings -> Data and Diagnostics -> Code Coverage. but afte I run a coded-ui test successfully, and went to "code coverage results", I found the information "Cannot find any coverage data (.coverage or. coveragexml) files. check test run details for possible errors". 

    then I found one Test Run warning: Disabling deployment is ignored for the test run because code coverage is enabled in the active test settings.

    Any clue for this?

    thanks!

     

    John Zhang

    Friday, May 14, 2010 8:44 AM

Answers

  • Could be two possible reasons:

    1. Dlls for which you want to collect Code Coverage may not be configured in Code Coverage data collection. You can mention assemblies for code coverage in Local.TestSettings -> Data and Diagnostics -> Code Coverage  -> Configure

    2. Are you trying to enable Code Coverage for a remote test execution (i.e. You are trying to run it using Test Controller & Test Agent)?You can only enable Code Coverage collection for the local runs.

    • Proposed as answer by Aditya_msft Sunday, May 16, 2010 11:56 AM
    • Marked as answer by Zhang Pengfei Monday, May 17, 2010 3:29 AM
    Sunday, May 16, 2010 11:56 AM

All replies

  • Could be two possible reasons:

    1. Dlls for which you want to collect Code Coverage may not be configured in Code Coverage data collection. You can mention assemblies for code coverage in Local.TestSettings -> Data and Diagnostics -> Code Coverage  -> Configure

    2. Are you trying to enable Code Coverage for a remote test execution (i.e. You are trying to run it using Test Controller & Test Agent)?You can only enable Code Coverage collection for the local runs.

    • Proposed as answer by Aditya_msft Sunday, May 16, 2010 11:56 AM
    • Marked as answer by Zhang Pengfei Monday, May 17, 2010 3:29 AM
    Sunday, May 16, 2010 11:56 AM
  • Yes, the reason is 1. I didn't check the target Dlls. thanks!
    Monday, May 17, 2010 3:29 AM
  • I'm having a similar problem.  I am trying to test a logic-rich custom Textbox control.   I am use a WPF test harness, a simple one MainWindow.xaml test screen.

    I'm getting good functionality with both white and coded UI.  They do what I need.  But I can't get code coverage to show any results.  I've flagged all my binaries for instrumentation in the code coverage config.  I know it is working because a simple MSTest constructor test shows coverage.  However both white and coded UI tests don't shown any code coverage.  Is it possible because I'm using WPF and the only use of the control is in the XAML markup?  Any advice is appreciated.

    Thanks,

    DAN


    DAN

    Friday, February 24, 2012 6:48 PM
  • I'm wondering if I am encountering the same issue, where the only thing being exercised is the XAML markup?
    Friday, March 9, 2012 8:56 PM
  • Hi Aditya,

    I have coded UI test dlls and application dlls added in code coverage configuration setings in local test settings. All these dlls get copied to out folder when I run test.

    After test passes when I see code coderage result it shows result only for test dlls.

    In directory structure, application dlls and test dlls are in different folders. Test dlls are in debug\bin directory and application dlls are in different directory created manually at root folder level.

    Is there any specific location and directory structure for application dlls where they should be copied, like in same directory of test dlls ??

    or any other setting I need to take care of ?

    Thanks, Akshay

    Tuesday, March 27, 2012 6:24 AM