0

Ran into a problem recently with VS/MSTest and wondering if anyone has had a similar issue.

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.

Selenium grid facilitates parallel test running but the running is done by MSTest. in the past few weeks parallel test running with VS has stopped working.

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.

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. 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.

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. Page Object approach.

Driver:Chromedriver 2.33

Chrome version: Version 62.0.3202.75 (Official Build) (64-bit)

Parallel test running enabled using a .Testsettings file in the solution

same thing happening with latest version of IE/IEDriverServer which makes me think it may be WebDriver that is an issue.

Any help or thoughts would be much appreciated.

Thanks,

G

Grimzy
  • 23
  • 7

2 Answers2

0

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. They run sequentially.

I've found this:

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). Please keep me posted.

brunochaina
  • 719
  • 7
  • 7
  • If you aren't using a .testsettings file to specify the amount of tests to run in parallel it will continue to run them sequentially. Even if you specify in Selenium Grid that you can run 5 tests on each node and in the .testsettings you only allow 2, 2 is all that will run in parallel. Adding this to the testsettings file and assigning those settings to your project will allow them to run in parallel – Grimzy Jul 09 '18 at 15:25
0

The issue here ended up being the javascript executor had been made static to add a feature one of the in house teams wanted. 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

Grimzy
  • 23
  • 7