title: Getting java.lang.RuntimeException: java.lang.NullPointerException
body: <pre><code>public  class TestScenario1 {
  
      @Test (dataProvider = "test")
      public void execute(String TestCol1,String TestCol2, String TestCol3,String TestCol4) throws Exception {            
          homePage hp = new homePage();
          hp.perform(TestCol1, TestCol2, TestCol3, TestCol4); 
      }
  
      @DataProvider(name= "test")
      public Object[][] testcase(ITestContext context) {
          String filepath = executionBase.CONFIG.getProperty("filepath");
          // String filepath = "D://workspace//Project//data//testData.xlsx";
          String sheetname = "Suite";
          return executionBase.getTestData(filepath, sheetname);
      } 
  }
  </code></pre>
  
  <p>If I execute above code it gives me following error: 
  <em>SKIPPED: execute
  java.lang.RuntimeException: java.lang.NullPointerException
      at org.testng.internal.MethodInvocationHelper.invokeDataProvider(MethodInvocationHelper.java:162)
      at org.testng.internal.Parameters.handleParameters(Parameters.java:430)</em></p>
  
  <p>But if I comment this line 
  String filepath =executionBase.CONFIG.getProperty("filepath");
  and execute following instead,
  String filepath = "D://workspace//Project//data//testData.xlsx";
  it works fine</p>
  
  <p>executionBase.class referred constructor code looks like,</p>
  
  <pre><code>public executionBase() throws IOException, FileNotFoundException {
      CONFIG = new Properties();
      FileInputStream ip = new FileInputStream(System.getProperty("user.dir")+ "//config//config.properties");
      CONFIG.load(ip);
  }
  </code></pre>
  
  <p>config.properties file entry goes like this,
  filepath=D:\workspace\Project\data\testData.xlsx</p>
  
  <p><strong>Function of executionBase.class works fine for other path variables provided in config.properties, but not sure why I am getting Null value for same under 
  @DataProvider(name= "test") annotation</strong> </p>