MSTest - 多次执行测试
我正在使用 MSTest 来驱动 Selenium,并且我想在同一次测试运行中针对多个浏览器执行测试。 有什么办法可以做到这一点吗?
谢谢, 内森
I'm using MSTest to drive Selenium, and I'd like to execute tests against multiple browsers in the same test run. Is there any way to do this?
Thanks,
Nathan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 DataSourceAttribute。 它能够根据数据源多次启动测试。 例如,我使用列出平台的 CSV 文件(在您的浏览器中)。
Take a look on 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).
内森,
不幸的是,我无法帮助 MSTest,但我确实对 Selenium 和并行执行了解很多(我是 RC 创始人之一,几年前创办了一家 Selenium-in-the-cloud 公司)。
一个问题:如果您计划在 Firefox、Safari 和 IE 下同时执行相同的测试,您是否考虑过可能存在由测试执行的工件引起的竞争条件? 例如,如果测试要创建新用户“bob”,则只有第一个测试会通过。
我是并行化的忠实粉丝,但它通常与状态管理和控制所述状态的固定装置齐头并进。 我很想知道您的情况如何,或者这些类型的问题是否对您的测试造成问题(它们的范围通常从“不是问题”到“严重问题”,具体取决于应用程序和测试)。
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).
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? For example, if the test were to create a new user "bob", then only the first test would pass.
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).