0

I was Wondering is it possible in the Testing Suite that is part of VS2012 to be able to construct a test using selenium which drivers the Web Site to the page which requires multiply test's and to be able to execute these test's in such a way that each test doesn't require the test case to go through a [TestInitialize ()] & [TestCleanup()]. So instead of the default behavior of testing where each test would go through a new browser session and all the required navigation, to the page where the test would take place then have an assertion performed. It would be able to go to the page once and run several test ?

Thanking you all in advance.

  • 1
    If you are asking can Selenium attach to an existing browser session that it's **not** created, then no. [This is not possible](https://code.google.com/p/selenium/issues/detail?id=18) ....but each test should not be creating a browser. You should be putting this higher up. In the `[ClassInitialize]` create one browser session, and use that for the life of that test class and all it's child tests. – Arran Jun 19 '13 at 08:33
  • Aha Thanks Arran. That does make more sense now. And I take it that I can use the TestInitialize for controlling other elements that are required for the tests to do their stuff. – ToxicBlotch Jun 19 '13 at 09:06
  • That sounds as though the tests are dependant on one another. What kind of elements are they? – Arran Jun 19 '13 at 11:09

0 Answers0