Integration tests using Selenium seem to run in parallel instead of sequentially

Hilmar van der Bijl's Avatar

Hilmar van der Bijl

20 Apr, 2015 12:12 PM

We are having an issue with our integration tests. These tests use selenium.

We have two tests that work fine if we only enable one or the other. When both tests are enabled, though, one of the tests keeps failing. Locally, these tests work fine, regardless of the state or outcome of the other one.

Could it be that these tests are somehow being run in parallel? If I look at the console window, I notice that two chromedrivers are started before the first test is marked as completed:

Starting ChromeDriver 2.12.301325 (962dea43ddd90e7e4224a03fa3c36a421281abb7) on port 1057
Only local connections are allowed.
Starting ChromeDriver 2.12.301325 (962dea43ddd90e7e4224a03fa3c36a421281abb7) on port 1150
Only local connections are allowed.
Passed   Test_1
Failed  Test_2

Since our integration tests rely on specific setup and teardown actions, it is important for them to be run in isolation. The order of the tests is of no relevance, though.

  1. Support Staff 1 Posted by Feodor Fitsner on 20 Apr, 2015 05:15 PM

    Feodor Fitsner's Avatar

    Hi Hilmar,

    What test framework is that?

  2. 2 Posted by Hilmar van der ... on 20 Apr, 2015 08:23 PM

    Hilmar van der Bijl's Avatar

    We use the Visual Studio Unit Testing Framework.

  3. Support Staff 3 Posted by Feodor Fitsner on 20 Apr, 2015 08:33 PM

    Feodor Fitsner's Avatar

    How do you run those tests locally?

  4. 4 Posted by Hilmar van der ... on 21 Apr, 2015 06:40 AM

    Hilmar van der Bijl's Avatar

    Simply by running them in the Visual Studio Test Explorer (CTRL+R,A).

    The tests are defined using TestStack's Seleno package.

  5. 5 Posted by Hilmar van der ... on 21 Apr, 2015 01:42 PM

    Hilmar van der Bijl's Avatar

    Hi Feodor,

    The problem was with our own tests. Turns out the driver is created as a singleton, and the context isnt cleared before each test. Deleting all cookies prior to each test fixed this issue.

    Sorry to waste your time.

  6. 6 Posted by Hilmar van der ... on 21 Apr, 2015 01:44 PM

    Hilmar van der Bijl's Avatar

    And the reason we saw two drivers being initialized was because that particular test was actually using two different browser windows.

  7. Support Staff 7 Posted by Feodor Fitsner on 21 Apr, 2015 01:44 PM

    Feodor Fitsner's Avatar

    Cool, thanks for update!

    - Feodor

  8. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:55 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

20 Mar, 2019 10:44 PM
20 Mar, 2019 09:03 PM
20 Mar, 2019 08:55 PM
20 Mar, 2019 08:48 PM
20 Mar, 2019 08:02 PM