简体   繁体   English

MSTest / Visual Studio并行测试运行

[英]MSTest/Visual Studio parallel test running

Ran into a problem recently with VS/MSTest and wondering if anyone has had a similar issue. 最近遇到了VS / MSTest的问题,想知道是否有人遇到过类似的问题。

I'm currently working on a UI framework in c# using MSTest and over the past few weeks I've been implementing selenium grid/Jenkins for CI. 我目前正在使用MSTest在c#中使用UI框架,在过去的几周中,我一直在为CI实施Selenium grid / Jenkins。

Selenium grid facilitates parallel test running but the running is done by MSTest. Selenium网格有助于并行测试运行,但是运行由MSTest完成。 in the past few weeks parallel test running with VS has stopped working. 在过去的几周中,使用VS运行的并行测试已停止工作。

No changes have been made to how the tests are structured or created but when multiple driver instances are created Driver A works until Driver B is created then Driver B runs while Driver A stops executing steps. 没有对测试的结构或创建方式进行任何更改,但是在创建多个驱动程序实例时,驱动程序A一直运行到创建驱动程序B为止,然后驱动程序B运行,而驱动程序A停止执行步骤。

I'm beginning to think it's a bug with WebDriver or MSTest itself as it's weird for something that was working to stop working without any code changes. 我开始认为这是WebDriver或MSTest本身的错误,因为对于某些在没有任何代码更改的情况下就可以停止工作的东西来说,这很奇怪。 Wondering if anyone else has had similar problems. 想知道是否有人遇到过类似的问题。

It had been working for me for months and I had found some issues by running in parallel so it's strange that it has suddenly stopped working with no changes. 它已经为我工作了几个月,我通过并行运行发现了一些问题,所以奇怪的是它突然停止了工作而没有任何变化。 It was last working around 2 months ago. 它的最后工作时间大约是2个月前。

I tried changing every static method/variable in the solution to not being static as I've read statics can cause problems but it didn't help. 我尝试将解决方案中的每个静态方法/变量更改为非静态,因为我已经阅读了静态方法,可能会导致问题,但并没有帮助。

setup is Unit Test solution using Seleno (Webdriver Nuget Package) Tests written as unit tests using in MSTest. 安装程序是使用Seleno(Webdriver Nuget软件包)的单元测试解决方案,它是在MSTest中使用单元测试编写的。 Page Object approach. 页面对象方法。

Driver:Chromedriver 2.33 驱动程式:Chromedriver 2.33

Chrome version: Version 62.0.3202.75 (Official Build) (64-bit) Chrome版本:62.0.3202.75版(正式版本)(64位)

Parallel test running enabled using a .Testsettings file in the solution 在解决方案中使用.Testsettings文件启用并行测试运行

same thing happening with latest version of IE/IEDriverServer which makes me think it may be WebDriver that is an issue. 最新版本的IE / IEDriverServer也发生了同样的事情,这使我认为可能是WebDriver引起了问题。

Any help or thoughts would be much appreciated. 任何帮助或想法将不胜感激。

Thanks, 谢谢,

G G

I'm having exactly the same issue. 我遇到完全相同的问题。 In my case, it's the first time I implement Selenium grid and try to run tests in parallel. 就我而言,这是我第一次实现Selenium网格并尝试并行运行测试。 They run sequentially. 它们按顺序运行。

I've found this: 我发现了这一点:

http://colinsalmcorner.com/post/parallel-testing-in-a-selenium-grid-with-vsts http://colinsalmcorner.com/post/parallel-testing-in-a-selenium-grid-with-vsts

Apparently the only way to solve it is putting tests in separate .csproj files, or maybe running multiple mstest processes with appropriate list of tests as arguments on each one (with some utility you can create). 显然,解决此问题的唯一方法是将测试放在单独的.csproj文件中,或者可能运行多个mstest进程,并在每个测试上使用适当的测试列表作为参数(可以使用某些实用程序创建)。 Please keep me posted. 请保持让我知道最新消息。

The issue here ended up being the javascript executor had been made static to add a feature one of the in house teams wanted. 这里的问题最终是使javascript执行程序静态化,以添加内部团队想要的功能之一。 Every time a new instance was opened the executor was assigned a new value and inputs happened only in the console of this window. 每次打开新实例时,都会为执行器分配一个新值,并且仅在此窗口的控制台中发生输入。

Implemented feature in a way that didn't require executor to be static and all worked well 以不需要执行者是静态的并且全部运行良好的方式实现了功能

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

相关问题 无法在Visual Studio Update1中并行运行mstest - Unable to run mstest in parallel in Visual Studio Update1 Visual Studio单元测试运行正常,MSTEST不能正常运行 - Visual Studio Unit Test runs fine, MSTEST does not 从Visual Studio中的MSTest或NUnit或控制台应用程序中运行Fitnesse测试 - Run fitnesse test out of MSTest or NUnit or console application in Visual Studio MSTest-使用Visual Studio服务(TFS和持续集成)运行测试 - MSTest - Running tests using visual studio services (TFS and Continous Integration ) 如何在不安装 Visual Studio 2010 的情况下使用 MSTest.ese 运行编码的 UI 测试 - How to run coded UI test with MSTest.ese without installing Visual Studio 2010 Specflow测试功能和不同项目中的步骤,使用MsTest运行时失败,但在Visual Studio中通过 - Specflow tests feature and steps in different projects, fail when running with MsTest, but pass in Visual Studio Visual Studio-在Visual Studio中按顺序运行数据驱动的测试 - Visual Studio - Running datadriven test sequentially in Visual Studio 在Visual Studio 2012中运行单元测试的问题 - Issue with running Unit Test in Visual Studio 2012 从外部运行Visual Studio Test项目 - Running Visual Studio Test project from outside 从Visual Studio UI运行测试类别 - Running a test category from the Visual Studio UI
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM