title: Facing NullPointerException in Selenium
body: <p>I have created three files: one is index file, other is configuration file and last the last one is the property file. While executing the code I'm getting <code>NULLPointerException</code>.</p>
  
  <p>I am not able to solve this issue. Please help me to rectify this code.                </p>
  
  <p><code>index.java</code>:</p>
  
  <pre><code>package main;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.chrome.ChromeDriver;
  import org.testng.annotations.Test;
  import config.Configuration;
  
  public class Index 
  {
      WebDriver driver;
      @Test(priority = 1)
      public void handling_multiple_windows() throws Exception
      {
          Configuration obj = new Configuration();
          System.setProperty("webdriver.chrome.driver", obj.path());
          driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get(obj.handling_window_url());
      }
  }
  </code></pre>
  
  <p><code>Configuration.java</code>:</p>
  
  <pre><code>package config;
  import java.io.File;
  import java.io.FileInputStream;
  import java.util.Properties;
  import org.openqa.selenium.WebDriver;
  
  public class Configuration 
  {
      Properties pro;
      WebDriver driver;
      public Configuration() throws Exception
      {
          File f = new File("./Config/config.property");
          FileInputStream fis = new FileInputStream(f);
          Properties pro = new Properties();
          pro.load(fis);  
      }   
  
      public String path()
      {
          String url = pro.getProperty("ChromeDriverPath");
          return url;
      }
  
      public String handling_window_url()
      {
          return pro.getProperty("URL");
      }
  }
  </code></pre>
  
  <p><code>config.property</code>:</p>
  
  <pre><code>ChromeDriverPath = G:\\Selenium Webdriver\\chromedriver\\chromedriver.exe
  URL = https://www.naukri.com
  </code></pre>