简体   繁体   English

如何在自动化UI测试期间运行ASP.NET应用程序?

[英]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). 我有一个ASP.NET应用程序(特别是ASP.NET MVC应用程序)。 I am wanting to write some MSTest tests for it that access it through the browser (using a library such as Selenium or WatiN). 我想为其编写一些MSTest测试,以通过浏览器(使用Selenium或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. 为了使我的UI测试正常工作,ASP.NET应用程序需要实际在Web服务器中运行,以便可以通过浏览器对其进行访问。 The application could be configured to run on IIS, IIS Express or Visual Studio Development Server. 可以将应用程序配置为在IIS,IIS Express或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? 测试运行时,如何确保ASP.NET应用程序在Web服务器上运行?

I would suggest using something like SpecsFor.Mvc 我建议使用类似SpecsFor.Mvc的东西

http://specsfor.com/SpecsForMvc/ 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. 运行测试时,SpecsFor.Mvc会应用您的Web配置转换,运行和托管应用程序,并在您选择的任何浏览器中启动测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 单击ASP.net控件时,如何使我的网页运行JavaScript代码? - How can I make my webpage run JavaScript code when an ASP.net control is clicked? 如何在 asp.net 中永远运行我的定时器? - How can I run my Timer forever in asp.net? 如何保护我的ASP.NET AJAX应用程序? - How can I secure my ASP.NET AJAX application? 我应该在ASP.NET应用程序中检查什么以确保它不会耗尽资源? - What should I check in my ASP.NET application to make sure it won't run out of resources? 如何使Active Directory文件夹中的用户可以在ASP.NEt应用程序中看到Web窗体? - How I can make that users from a Active Directory Folder can see a webform in my ASP.NEt Application? 为什么我不能在运行时编辑我的ASP.NET Web应用程序? - Why can't I edit my ASP.NET Web application at run time? 如何制作一个可以在安卓手机上运行的asp.net应用程序 - how to make a asp.net application that can run on android mobile 如何使我的ASP.NET应用程序可在任何主机上安装 - How to make my ASP.NET Application Installable on any host 我如何为asp.net Web应用程序构建类体系结构 - How can i build my class architecture for my asp.net web application 如何从我的Android应用程序传递数据并在我的ASP.NET MVC网站上接收它? - How can I pass data from my android application and receive it on my ASP.NET MVC website?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM