locked
Code Coverage in visual Studio 2012 RRS feed

  • Question

  • Hi,

    I am working on code coverage analysis using vs2012.

    when i individually run code coverage for a test method it prompting exact code coverage.

    But when running for All test methods simultaneously few of test cases get fail.

    I am following this walk-through.   Test-->Analyze Code Coverage-->All Tests.

    Can any body tell why it is behaving like soo..

    Thanks and Regards

    Divya

    Friday, May 10, 2013 10:33 AM

Answers

All replies

  • Hi Divya,

    Which kind of test are you running, the Coded UI Test or unit tests?

    If you just run all tests under Test->Run->All Tests, whether all tests run well?  If not, I’m afraid that you would get the issue if you want to get the code coverage. You’d better check the detailed error message if you get the test result is failed.

    In addition, you could select all tests in the test explorer window, right click them->Analysze Code Coverage for Selected Tests, check it again. I try to run two test methods as your steps, it works well in my side.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, May 13, 2013 10:50 AM
  • Hi Divya,

    I am writing to check the status of the issue on your side. 

    What about this problem now?

    Would you mind letting us know the result of the suggestion?

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 16, 2013 3:24 AM
  • I regret to say that your solution didn't help me,  we have just updated the order of test methods and it works.

    Still I m wondering for exact reason , but by doing so it works.

    Thanks

    Divya

    Thursday, May 16, 2013 4:57 AM
  • Hi Divya,

    Sorry for my reply no help.

    We have just updated the order of test methods and it works.

    As you said that if you run your test in order, it worked well, I doubt that your tests need to have the specific order. I’m not very sure which kind of tests are you running, for example, if we have three coded UI tests test1/2/3, the test 2 would load the UI after the test 1 finished. But if the test 2 runs before the test 1, I’m afraid that it will impact the result. So it will work well if you run it in order.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Thursday, May 16, 2013 8:09 AM