title: How to remove this [RemoteTestNG] detected TestNG version 7.2.0 FAILED: basePageNavigation java.lang.NullPointerException
body: <p>I have written the below code which is one of the programs in designing a framework and it is giving me this below error every time. Can someone pls help me in fixing this issue.  [RemoteTestNG] detected TestNG version 7.2.0 FAILED: basePageNavigation java.lang.NullPointerException</p>
  <pre><code>package ArjunSelenium.E2Eproject;
  
  import java.io.FileInputStream;
  import java.io.IOException;
  import java.util.Properties;
  import java.util.concurrent.TimeUnit;
  
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.chrome.ChromeDriver;
  import org.openqa.selenium.firefox.FirefoxDriver;
  import org.openqa.selenium.ie.InternetExplorerDriver;
  import org.testng.annotations.Test;
  
  public class Base {
      
      public WebDriver driver=null;
      
      @Test
      public WebDriver initializeDriver() throws IOException {
          
          Properties prop=new Properties();
          FileInputStream fis=new FileInputStream(&quot;C:\\Users\\Arjun\\eclipse-workspace\\E2Eproject\\src\\main\\java\\ArjunSelenium\\E2Eproject\\data.properties&quot;);
  
          prop.load(fis);
          
          String browserName=prop.getProperty(&quot;browser&quot;);
          
          if(browserName.equals(&quot;chrome&quot;)) {
              
              System.setProperty(&quot;webdriver.chrome.driver&quot;, &quot;C:\\Users\\Arjun\\Desktop\\ChromeDriver\\chromedriver.exe&quot;);
              driver = new ChromeDriver();
              
          }else if(browserName.equals(&quot;firefox&quot;)) {
              System.setProperty(&quot;webdriver.gecko.driver&quot;, &quot;C:\\Users\\Arjun\\Desktop\\firefoxdriver\\geckodriver.exe&quot;);
              driver = new FirefoxDriver();
              
          }else if(browserName.equals(&quot;IE&quot;)) {
              System.setProperty(&quot;webdriver.ie.driver&quot;, &quot;C:\\Users\\Arjun\\Desktop\\ied2\\IEDriverServer.exe&quot;);
              driver = new InternetExplorerDriver();
              
          }
           
          driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
          return driver;
      }
  }
  </code></pre>
  <p>and below is the test base class which the above program is extending</p>
  <pre><code>package ArjunSelenium.E2Eproject;
  
  import java.io.IOException;
  
  import org.testng.annotations.Test;
  
  public class HomePage extends Base{
      
      @Test
      public void basePageNavigation() throws IOException {
          
          driver=initializeDriver();
          driver.get(&quot;https://www.youtube.com/&quot;);
        }
  }
  </code></pre>
  <p>AND THIS IS POPPING UP IN MY CONSOLE</p>
  <pre><code>[RemoteTestNG] detected TestNG version 7.2.0
  FAILED: basePageNavigation
  java.lang.NullPointerException
      at ArjunSelenium.E2Eproject.Base.initializeDriver(Base.java:43)
      at ArjunSelenium.E2Eproject.HomePage.basePageNavigation(HomePage.java:12)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:135)
      at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:598)
      at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174)
      at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
      at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:821)
      at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147)
      at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
      at java.base/java.util.ArrayList.forEach(ArrayList.java:1510)
      at org.testng.TestRunner.privateRun(TestRunner.java:767)
      at org.testng.TestRunner.run(TestRunner.java:588)
      at org.testng.SuiteRunner.runTest(SuiteRunner.java:384)
      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378)
      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337)
      at org.testng.SuiteRunner.run(SuiteRunner.java:286)
      at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
      at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
      at org.testng.TestNG.runSuitesSequentially(TestNG.java:1214)
      at org.testng.TestNG.runSuitesLocally(TestNG.java:1136)
      at org.testng.TestNG.runSuites(TestNG.java:1066)
      at org.testng.TestNG.run(TestNG.java:1034)
      at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
      at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
      at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
  
  
  ===============================================
      Default test
      Tests run: 1, Failures: 1, Skips: 0
  ===============================================
  
  
  ===============================================
  Default suite
  Total tests run: 1, Passes: 0, Failures: 1, Skips: 0`enter code here`
  ===============================================
  </code></pre>
  <p>PLEASE HELP ME OUT TO REMOVE THIS ERROR.</p>