问题
Does anyone know of a way to create Code Coverage reports for C#/.NET projects tested via Selenium?
回答1:
I was able to find the following article "Code Coverage of ASP.NET Applications on IIS" from the folks at NCover, not free, which supports IIS instrumentation and code coverage. This would enable you to run Selenium and gather coverage results.
That ASP.NET applications are fairly difficult to test may be the understatement of the century. In this article, we’re going to show you how to test ASP.NET applications with Selenium, and how to use NCover to review your test coverage.
While it is possible to get 100% coverage for your ASP.NET application using Selenium, we highly recommend that you develop your application in layers and test as many of those layers as possible with a unit testing framework such as NUnit, MSTest, or MbUnit.
回答2:
OpenCover is also a possibility if you use iisexpress
来源:https://stackoverflow.com/questions/9824990/c-sharp-code-coverage-with-selenium