简体   繁体   中英

How can I make my ASP.NET application run during my automated UI tests?

I have an ASP.NET application (specifically, it's an ASP.NET MVC application). I am wanting to write some MSTest tests for it that access it through the browser (using a library such as Selenium or WatiN).

In order for my UI tests to work, the ASP.NET application needs to be actually running in a web server so that it can be accessed through the browser. The application could be configured to run on IIS, IIS Express or Visual Studio Development Server. (I want all three configurations to be supported.)

How can I ensure that the ASP.NET application is running on a web server when the tests are run?

I would suggest using something like SpecsFor.Mvc

http://specsfor.com/SpecsForMvc/

It does a lot of the hard work for you. You write integration tests, just like you would write normal unit tests.

When you run the tests, SpecsFor.Mvc applies your web config transforms, runs and hosts the app, and kicks off the tests in whichever browser you choose.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM