Customizing Visual Studio run configuration to run tests after launching application

﹥>﹥吖頭↗ 提交于 2019-12-13 03:42:12

问题


Here are the details of my Development Environment:

  • Visual Studio 2012 Ultimate with Update 4

    Google Chrome Version 38.0.2125.111 m

    Windows 7 Professional with 32-bit Operating System

    Coded UITest Builder 11.0.60315.1

Microsoft Coded UITest Project is within the ASP.NET Web Application Solution.

We use the Microsoft Coded UITest Project to run Automated UI tests on the Web application.

Here is what needs to be done.

I need to build and run the ASP.NET Web Application Solution so that the Web Application will be deployed to Visual Studio Development server, and then ultimately show up in the Google Chrome Browser. ( In other words, you highlight solution in Visual Studio and press F5 to build and run. )

The problem is that if I build and run the application, I want the aforementioned Microsoft Coded UITest Project to run Automated UI tests after the Web Application is up and running.

Also, it's important to keep in mind that there needs to be a delayed start for the Automated UI tests because it will obviously take time for the Web Application to be up and running.

How can I automate the above using Visual Studio's build and run ( i.e pressing F5) process?


回答1:


Normally there is a build server involved in that process and when you build your code you can specfiy whethere you wan tot run the tests or not after a sucessfull build.

Or you can do Test -> Test Settings -> Run Test after Build in Visual Studio.

Hope this helped




回答2:


I switched to using NUnit Framework instead of Microsoft Coded UI. However, I still use Selenium.

@alagesan-palani post ( Integrating NUnitTesting GUI to Visual studio 2012 and debugging Test Cases ) has helped me resolve my problem.

Moreover, @alagesan-palani was kind enough to post a the following link to a webpage that explains in some detail how to run NUnit test cases for the above problem:

http://blog.toddbauer.me/2011/02/17/debugging-net-nunit-tests-in-visual-studio/



来源:https://stackoverflow.com/questions/26838133/customizing-visual-studio-run-configuration-to-run-tests-after-launching-applica

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!