title: C# Extending Selenium Webdriver Class
body: <p>I would like to add a static string property that will track the name of the current test running. I figured the best way to go about this was to use the WebDriver since it is the only object that is carried throughout all of my page objects.</p>
  
  <p>Is there a way to extend the WebDriver class to add a string property that I can set?</p>
  
  <p>EDIT: Since WebDriver uses the IWebDriver interface rather would I extend the interface perhaps?</p>
  
  <p>EDIT #2: Adding example of what I currently have to load my WebDriver:</p>
  
  <pre><code>protected static NLog.Logger _logger = LogManager.GetCurrentClassLogger();
  protected static IWebDriver _driver;
  
  /// &lt;summary&gt;
  /// Spins up an instance of FireFox webdriver which controls the browser using a
  /// FireFox plugin using a stripped down FireFox Profile.
  /// &lt;/summary&gt;
  protected static void LoadDriver()
  {
      ChromeOptions options = new ChromeOptions();
      try
      {
          var profile = new FirefoxProfile();
          profile.SetPreference("browser.helperApps.neverAsk.saveToDisk", "application/octet-stream doc xls pdf txt");
  
          _driver = new FirefoxDriver(profile);
          _driver.Navigate().GoToUrl("http://portal.test-web01.lbmx.com/login?redirect=%2f");
      }
      catch(Exception e)
      {
          Console.WriteLine(e.Message);
          throw;
      }
  }
  </code></pre>