How to: Run Tests from Microsoft Visual Studio

本文详细介绍了在Visual Studio中运行自动化测试的多种方式,包括从Test Explorer、Load Test Editor、源代码文件以及特定测试代码文件运行测试。提供了如何在Test Explorer中运行所有测试、选择性运行测试、重新运行上一次测试以及分析代码覆盖率等功能。

https://msdn.microsoft.com/en-us/library/ms182470.aspx

Running Automated Tests in Visual Studio

Visual Studio provides different ways to run tests. You can choose the way that best suits your current needs:

  • Run Tests From Test Explorer. You can run automated tests including unit, coded UI, ordered, and generic in your solution from Test Explorer. Test Explorer easily lets you run and monitor the status of all the automated tests in your solution.

  • Run load tests from the load test editor. Load tests and web performance tests are run from either the Load Test Editor, the Web Performance Test Editor, or from the Visual Studio Enterprise LOAD TEST menu. For more information, see Running Load and Web Performance Tests.

  • Run Tests From Your Source Code Files. By using the keyboard, you can run tests from any text-based file in your solution. In particular, you can run tests while editing a file that contains your code under test. This lets you change source code and immediately test it without using a window or a menu.

  • Run Tests From Files in Your Test Code Files. By using the mouse or the keyboard, you can run tests from the file that contains your test code. This lets you change a test and then run it immediately without using a window or a menu.

Run Tests from Test Explorer

TestExplorer在菜单中的位置Test-->Windows-->TestExplorer

To run tests from Test Explorer

  • In Test Explorer, choose Run All. Or, select the tests you want to run, right-click, and then choose Run Select Tests.

    The automated tests will run and indicate if they passed or failed.

You can also choose the drop-down list under Run for other options including Run Failed Tests, Run Not Run Tests, Run Passed Tests,Repeat Last Run, and Analyze Code Coverage.

To view Test Explorer from the Test menu, point to Windows and then choose Test Explorer.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值