title: selenium driver value returning as NULL for website
body: <p>Hi Below are the code,</p>
  
  <p>Issue:
  driver value under Acti_01Login page is retunring driver value as NULL, hence it is thorwing exception. How to handle and make sure its not returning the NULL value.</p>
  
  <pre><code>////////////////////////////Page Object Model:
  public class Acti_01LoginPage
  {
      private static WebElement element = null;
      static WebDriverWait wait;
  
  
      //Username TextBox
      public static WebElement input_TxtUsername(WebDriver driver)
       {
      System.out.println("Driver in Action login page "+ driver);  
      try
      {
          element =driver.findElement(By.id("username"));
          Log.info("Username textbox element is found");
          //System.out.println(element);
  
      }
      catch (WebDriverException e)
      {
              //System.out.println(e.getMessage());
              Log.info("Username textbox element is not found due to "+e.getMessage());
      }
       return element;
   }
  
  //ActionOpenBrowser
  package funcModule;
  
  import java.util.concurrent.TimeUnit;
  
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.chrome.ChromeDriver;
  import org.openqa.selenium.firefox.FirefoxDriver;
  
  import utility.Constant;
  
  public class Acti_03ActionOpenBrowser 
  {
  
      WebDriver driver=null;
  
          public  WebDriver openBrowser(String sBrowserName) throws Exception
          {
  
  
              if(sBrowserName.equalsIgnoreCase("Mozilla"))
              {
  
                  driver = new FirefoxDriver();
  
                  driver.get(Constant.URL);
                  driver.manage().timeouts().implicitlyWait(40, TimeUnit.SECONDS);
  
                  }
              else if(sBrowserName.equalsIgnoreCase("chrome"))
              {
  
                  System.setProperty("webdriver.chrome.driver","chromedriver.exe");
                  driver = new ChromeDriver();
                  driver.get(Constant.URL);
                  driver.manage().timeouts().implicitlyWait(40, TimeUnit.SECONDS);
  
              }
  
              return driver;
          }
  
  }
  
  Callin in Main function:
  public class POMtest1 {
  
      private static WebDriver driver = null;
      public static void main(String[] args) throws Exception 
      {
          Acti_03ActionOpenBrowser.setup();
  
          Acti_01LoginPage.input_TxtUsername(driver).sendKeys("vjha9009");
  
          Acti_01LoginPage.input_TxtPassword(driver).sendKeys("Password123");
          Acti_01LoginPage.click_BtnLogin(driver).click();
  
  
      }
  
  }
  </code></pre>
  
  <p>Request you to help me out.</p>