I struggled with both these problems myself. In the end I developed a custom Nunit test runner that is capable of running multiple tests in parrallel. This combined with the Taumuon.Rakija extension for nunit allowed the tests to be dynmaically created depending on which browser you want the test to run on.
I'm now in a position where I can launch my test suite against as many browser types on as many operating systems as I wish in parrallel.
Unfortunately there doesn't seem to be a good solution to these problems already so you'll probably have to solve them yourself for your particular environment.
Igor Brejc has a blog post about running tests in parallel using MbUnit.
However he does say "Once we integrate Selenium into acceptance testing", so it looks like he was just experimenting, I can't find any other posts so I don't know if he has successfully run Selenium tests in parallel.
发布评论
评论(5)
关于这个主题还没有很多工作。 我没有找到任何真正相关的东西。
然而,你的观点得到了很好的理解。 与强大的单核 CPU 相比,现在大多数机器都拥有更多的核心和更弱的核心。
所以我确实在微软博客上找到了一些东西。 该技术称为 PUnit,专门用于测试多线程环境。
它尽可能接近您所要求的内容:)
您可以在那里访问相应的博客文章:http://blogs.microsoft.co.il/blogs/eyal/archive/2008/07/09/punit -parallel-unit-testing-in-making.aspx
更新:链接不再有效。 CodePlex 上的项目已被删除。
更新 2:这是 NUnit 2.5 的路线图。 参考
There hasn't been a lot of work on this subject. I didn't find anything really relevent.
However, your point is well taken. Most machines nowadays have more cores and less powerful cores compared to powerful one core cpu.
So I did find something on a Microsoft blog. The technology is called PUnit and is made especially for testing multi-threaded environment.
It's as close as possible to what you requested that I could find :)
You can visit it the appropriate blog post right there: http://blogs.microsoft.co.il/blogs/eyal/archive/2008/07/09/punit-parallel-unit-testing-in-making.aspx
Update: Link is not valid anymore. The project on CodePlex has been removed.
Update2: This is on the roadmap for NUnit 2.5. Reference
我自己也曾为这两个问题而苦苦挣扎。 最后,我开发了一个自定义的 Nunit 测试运行器,它能够并行运行多个测试。 这与 nunit 的 Taumuon.Rakija 扩展相结合,允许根据您希望测试运行的浏览器动态创建测试。
我现在可以在任意数量的操作系统上针对任意数量的浏览器类型并行启动我的测试套件。
不幸的是,这些问题似乎还没有一个好的解决方案,因此您可能必须针对您的特定环境自行解决它们。
I struggled with both these problems myself. In the end I developed a custom Nunit test runner that is capable of running multiple tests in parrallel. This combined with the Taumuon.Rakija extension for nunit allowed the tests to be dynmaically created depending on which browser you want the test to run on.
I'm now in a position where I can launch my test suite against as many browser types on as many operating systems as I wish in parrallel.
Unfortunately there doesn't seem to be a good solution to these problems already so you'll probably have to solve them yourself for your particular environment.
NUnit 版本 3 将支持并行运行测试,这与 Selenium Grid 配合使用效果很好:
将属性添加到类:
[Parallelizes(ParallelScope.Self)]
将与其他测试类并行运行测试。NUnit 框架并行测试执行
NUnit version 3 will support running tests in parallel, this works good with a Selenium Grid:
Adding the attribute to a class:
[Parallelizable(ParallelScope.Self)]
will run your tests in parallel with other test classes.NUnit Framework-Parallel-Test-Execution
Igor Brejc 有一篇关于使用 MbUnit 并行运行测试的博客文章。
然而他确实说“一旦我们将 Selenium 集成到验收测试中”,所以看起来他只是在试验,我找不到任何其他帖子,所以我不知道他是否已成功并行运行 Selenium 测试。
http://igorbrejc.net/development/continuous-integration/ gallio-并行运行测试
Igor Brejc has a blog post about running tests in parallel using MbUnit.
However he does say "Once we integrate Selenium into acceptance testing", so it looks like he was just experimenting, I can't find any other posts so I don't know if he has successfully run Selenium tests in parallel.
http://igorbrejc.net/development/continuous-integration/gallio-running-tests-in-parallel
您可以使用任务并行库和DynamicObject类来实现同一测试在多个浏览器上的并行化。 请参阅我的文章 并行运行 Selenium任何 .NET 单元测试工具 了解详细信息。
You can use the Task Parallel Library and the DynamicObject class to achieve parallelization of the same test on multiple browsers. See my article Running Selenium In Parallel with any .NET Unit Testing Tool for details.