简体   繁体   English

MSTest-多次执行测试

[英]MSTest - Executing Tests Multiple Times

I'm using MSTest to drive Selenium, and I'd like to execute tests against multiple browsers in the same test run. 我正在使用MSTest来驱动Selenium,并且我想在同一测试运行中针对多个浏览器执行测试。 Is there any way to do this? 有什么办法吗?

Thanks, Nathan 谢谢,内森

Take a look on DataSourceAttribute . 看一下DataSourceAttribute It gives ability to start tests muliple times based on data source. 它提供了根据数据源开始测试多个时间的功能。 For example I use CSV file that lists platforms (in your case browsers). 例如,我使用列出平台的CSV文件(在您的浏览器中)。

Nathan, Unfortunately I can't help with MSTest, but I do know a lot about Selenium and parallel execution (I'm one of the RC founders and started a Selenium-in-the-cloud company a few years back). 内森(Nathan),不幸的是我无法帮助MSTest,但我对Selenium和并行执行了解很多(我是RC创始人之一,几年前开了一家Selenium-in-cloud-cloud公司)。

One question: if you're planning to execute the same test at the same time under Firefox, Safari, and IE, have you considered that there may be race conditions caused by artifacts of the test execution? 一个问题:如果您打算在Firefox,Safari和IE下同时执行相同的测试,您是否考虑过由测试执行工件引起的竞争情况? For example, if the test were to create a new user "bob", then only the first test would pass. 例如,如果测试要创建一个新用户“ bob”,则只有第一个测试会通过。

I'm a big fan of parallelization, but often it goes hand-in-hand with state management and solid fixtures that control said state. 我是并行化的忠实拥护者,但通常它与状态管理和控制所述状态的坚固夹具并驾齐驱。 Would love to hear how it goes for you or if these types of issues are a problem for your tests (they often range from being "not a problem" to a "serious problem" depending on the app and the test). 很想听听您的情况,或者这些问题对于您的测试是否有问题(取决于应用程序和测试,它们的范围通常从“不是问题”到“严重问题”)。

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

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