I've been struggling with this for a while. We plan to move to a continuous integration server soon (probably TFS or Jenkins). I'm having a hard time figuring out how to efficiently manage the webdriver to run all tests in selected number of browsers. Locally I use Resharper to run my tests.
What I want is an effective way to run tests for all browsers, and sometimes locally one browser. I want efficient webdriver management for grid2. What is the ideal life of a WebDriver? A test fixture class? Or entire testing session? When should I call Exit() or Quit()?
Before I just commented/uncommented out the browser I wanted in a Static Factory method, having one instance per testing session, which makes it impossible to run all the tests on all browsers and compare side by side results and parallelize the running of tests (which theoretically TeamCity can do).
I have tried adding a
[TestFixture(Browser.XXXX)] enums to a top level
WebDriverTest superclass and then setting the web driver from a factory method in the test fixture setup. The problem is, adding many of these disables the possibility of parameterizing the the
[TestFixture] attribute in subclasses. And I had some unexpected behavior (IEWebDriver completely not working) when I had multiple of these attributes.
The OOP suggestion is a test configuration. I'm not sure how to programatically configure the unit test settings in NUnit. Can this be done in C# (ideal) or does it need to be something attached to the Test Runner (not ideal, if i have multiple test runners).
Any ideas to help me better run a Selenium Testing suite in IE would be great.
PS: I also tried Gallio/MBUnit. The tests ran in parallel but not stable. And I can't find a test runner as nice as Resharper.