title: C#, selenium webdriver
body: <p>I want to create a variable webdriver that i can call in all of my tests. 
  I currently have the following example for display purposes. </p>
  
  <p>Here I define my webdriver I want to use:</p>
  
  <pre><code>using OpenQA.Selenium;
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using NUnit.Framework;
  using OpenQA.Selenium.Chrome;
  using OpenQA.Selenium.PhantomJS;
  
  namespace WebAuto
  {
      public class OpenBrowser
      {
          private static IWebDriver driver = new ChromeDriver();
  
          public IWebDriver getDriver()
          {
              return driver;
          }
      }
  }
  </code></pre>
  
  <p>Now i want to call this webdriver in another Test called Login:</p>
  
  <pre><code>using OpenQA.Selenium;
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using NUnit.Framework;
  using OpenQA.Selenium.Chrome;
  using OpenQA.Selenium.PhantomJS;
  
  
  namespace WebAuto
  {
      public class Login 
      { 
          public static void Login1() 
      {
              //var driver = new ChromeDriver();
              OpenBrowser.IWebDriver. getDriver();
              driver.Navigate().GoToUrl("www.anywebsite.com");
              //driver.Navigate().GoToUrl("www.anywebsite.com");
              //driver.WaitForPageToLoad();
              var inputtext1 = driver.FindElement(By.Id("lgLogin_txtUserId"));
              //inputtext1.Focus();
              inputtext1.SendKeys("User");
              var inputpassword1 = driver.FindElement(By.Id("lgLogin_txtPassword"));
              //inputpassword1.Focus();
              inputpassword1.SendKeys("Password");
              var inputbutton1 = driver.FindElement(By.Id("btnLoginClient"));
              inputbutton1.Click();
              //driver.WaitForPageToLoad();
  
          }
  
      }
  }
  </code></pre>
  
  <p>Could someone please explain what I am missing????</p>