locked
Web test with Code Coverage RRS feed

  • Question

  • Hi all,

    I'm new about test with VS, I create a web test, I click Local.testsetings->Data and Diagnostics->select Code Coverage, and then run it, but I get nothing, I can't find Code Coverage. Why? Have I missed some settings?

    Regards,

    Feng

    Tuesday, August 23, 2011 2:05 AM

Answers

  • Yeah, make sure that you have selected some product assemblies to be instrumented, code coverage is calculated against those.

    Thanks,

    Anuj


    http://www.anujchaudhary.com/
    • Marked as answer by Le Feng Thursday, September 1, 2011 9:18 AM
    Tuesday, August 23, 2011 8:31 AM

All replies

  • Hello Feng,

    See this article Walkthrough: Run Tests and View Code Coverage. Do as the steps provided by this article.

    Regards

    Fan


    When you help others, it's help yourself!
    Tuesday, August 23, 2011 3:47 AM
  • Yeah, make sure that you have selected some product assemblies to be instrumented, code coverage is calculated against those.

    Thanks,

    Anuj


    http://www.anujchaudhary.com/
    • Marked as answer by Le Feng Thursday, September 1, 2011 9:18 AM
    Tuesday, August 23, 2011 8:31 AM
  • Hi Feng,

    Fan and Anuj has pointed out correct start to collect code coverage for web test.  I'd like to make sumplement. To collect code coverage, generally we need these steps:

    1) Create test project along with the web app project;

    2) Add web performance test to test project;

    3) Instrument necessary binaries: Select web app which is what we want to instrument;

    4) In Web Performance Test Editor, click command icon Parameterize Web Servers, Change Web Server dialog opens, select use ASP.NET Development Server. Enter web app project path to Path to Web Site text box. OK. Done

    Now you can run your test and code coverage should ge generated. It's in Code Coverage Results tool window.

    [new edit] Refer to: http://blogs.msdn.com/b/slumley/archive/2008/07/08/collecting-code-coverage-data-when-running-web-load-tests.aspx

    Hope this helps, please let us know if you figured out or have more question.

    Best Regards,


    Forrest | MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Tuesday, August 30, 2011 4:55 PM
    Moderator