title: Not able to run selenium script using phantomjs driver
body: <p>I am new to phantomjs driver, I need to run my script in background using phantomjs headless driver.<br>
  Here is my code i am getting null-pointer exception.
  currently am using selenium 2.32,testNG,phantomjs jar 1.0.3   </p>
  
  <pre><code>public class PhantomjsDemo {
  
  public WebDriver driver;
  
  @BeforeMethod
  public void setup(){
      DesiredCapabilities caps = new DesiredCapabilities();
      caps.setJavascriptEnabled(true);
      caps.setCapability("takesScreenshot", true);
      caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,"C:\\phantomjs-1.9.2-windows\\phantomjs.exe");
       WebDriver driver = new PhantomJSDriver(caps);
       driver.get("www.google.com");
  }
  
  @Test
  public void google(){
      driver.findElement(By.xpath("//*[@id='gbqfba']")).getText();
      driver.findElement(By.xpath("//*[@id='gbqfba']")).getSize().getHeight();
      driver.findElement(By.xpath("//*[@id='gbqfba']")).getSize().getWidth();
      driver.findElement(By.xpath("//*[@id='gbqfba']")).click();
  }
  
  @AfterMethod
  public void close(){
      driver.quit();
  }
  }
  </code></pre>