title: How to call a java class in selenium webdriver?
body: <p>just started learning selenium-webdriver and trying too....soo here is my dout?</p>
  
  <p><strong>below created a function navigate to google home page</strong>
  <pre> 
  package UtilityGoogle;</p>
  
  <p>import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.firefox.FirefoxDriver;</p>
  
  <p>public class HomePage {
       WebDriver WD=null;</p>
  
  <code>public static void main(WebDriver WD) {
      // TODO Auto-generated method stub
      WD = new FirefoxDriver();
      WD.navigate().to("https://www.google.co.in");
      WD.manage().window().maximize();
  
      return;
  }
  </code></pre>
  
  <p></p>
  
  <p><strong>and below code calling Homepage function..</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>package GoogleMain;
  
  import org.openqa.selenium.WebDriver;
  import org.testng.AssertJUnit;
  import org.testng.annotations.Test;
  import UtilityGoogle.HomePage;
  
  public class Google_Tc1 {
    private static WebDriver XP = null;@
    Test
    public void Open() {
      HomePage HP = new HomePage();
      String actual = XP.getTitle();
      String expected = "Google";
      AssertJUnit.assertEquals(expected, actual);
    }
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Getting below error .... please do help me to fix this</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>FAILED: Open
  java.lang.NullPointerException
   at GoogleMain.Google_Tc1.Open(Google_Tc1.java:13)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)</code></pre>
  </div>
  </div>
  </p>