title: How to Initialize a C# Selenium webdriver test to pass in different browser types?
body: <p>I want to pass into my unit tests which browser to use (Firefox, Chrome, IE).</p>
  
  <pre><code>    [TestInitialize()]
      public void Initialize(string URL, string Country, string Browser)
      {
          this.URL = URL;
          this.Country = Country;
          this.Browser = Browser;
      }
  </code></pre>
  
  <p>Something like:</p>
  
  <pre><code>    public DefaultDriver _webDriver  = new DefaultDriver();
  </code></pre>
  
  <p>Then assign the Default Driver to the correct Browser type:</p>
  
  <pre><code>        if (Browser == "Firefox")
              _webDriver = _firefoxDriver;
          else if (Browser == "Chrome")
              _webDriver = new ChromeDriver();
          else if (Browser == "IE")
              _webDriver = new InternetExplorerDriver();
  </code></pre>
  
  <p>But this doesnt work as there is no DefaultDriver that is compatible with ChromeDriver, FireFoxDriver, and InternetExplorerDriver that I can find.  What would be a good way to do this or another way to accomplish sending in the browser type in C#?  I'm using a form application to run the tests and want to pass in different browsers to the same test.</p>