title: Cannot invoke "org.openqa.selenium.WebDriver.findElement(org.openqa.selenium.By)" because "this.driver" is null
body: <p>when I try to run below code in <code>testNg</code> <code>null pointer exception</code> shown in <code>Eclipse</code></p>
  <pre><code>public class ImgDDChkbxRadio  {
      WebDriver driver;
      
      @BeforeTest
      public void LaunchBrowser()
      {
          System.setProperty(&quot;webdriver.chrome.driver&quot;,&quot;F:\\chromedriver_win32\\chromedriver.exe&quot;);
          WebDriver driver=new ChromeDriver();
          driver.manage().window().maximize();
          driver.get(&quot;http://www.leafground.com/&quot;);
      }   
      @Test
      public void Img()
      {   
          driver.findElement(By.xpath(&quot;//img[@src='images/image.png']&quot;)).click();
          driver.findElement(By.xpath(&quot;//*[@src=\&quot;../images/home.png\&quot;]&quot;)).click();
          driver.navigate().back();
          driver.findElement(By.xpath(&quot;//*[@src=\&quot;../images/abcd.jpg\&quot;]&quot;)).click();
          
      }
  }
  </code></pre>