title: Selenium web element findby click is null
body: <p>I've had a problem with the Selenium web driver trying to find a button on the page and click it. The page buffers every time so I implemented a wait time and it's still not working. Is there another command I should use or is this an easy fix?</p>
  <p><strong>Error:</strong></p>
  <pre><code>//java.lang.NullPointerException: Cannot invoke &quot;org.openqa.selenium.WebElement.click()&quot; because &quot;this.facilitySelect&quot; is null
   at com.katalon.kata.sample.testcase.simple.MakeAppointmentTest.shouldMakeAppointment(MakeAppointmentTest.java:40)].
  </code></pre>
  <p><strong>Code:</strong></p>
  <pre><code>package com.katalon.kata.sample.testcase.simple;
  import com.katalon.kata.sample.Constants;
  import com.katalon.kata.sample.page.CuraAppoinmentPage;
  import com.katalon.kata.sample.page.CuraAppointmentConfirmPage;
  import com.katalon.kata.sample.page.CuraHomePage;
  import com.katalon.kata.sample.page.CuraLoginPage;
  import com.katalon.kata.testng.TestTemplate;
  import org.testng.annotations.Test;
  import java.io.IOException;
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.support.FindBy;
  import java.util.concurrent.TimeUnit;
  
  public class MakeAppointmentTest extends TestTemplate {
  
    private CuraHomePage curaHomePage = new CuraHomePage(Constants.baseUrl);
  
    private CuraLoginPage loginPage;
  
    //private CuraAppoinmentPage curaAppoinmentPage;
  
    //private CuraAppointmentConfirmPage curaAppointmentConfirmPage;
    @FindBy(id = &quot;btnClose&quot;)
    private WebElement facilitySelect;
    
    @FindBy(id = &quot;btnbillingModeOK&quot;)
    private WebElement bookAppointmentBtn;
    
  
    @Test
    public void shouldMakeAppointment() throws IOException {
      
     //curaHomePage.makeAppointment();
     curaHomePage.open();
      loginPage.login(Constants.username, Constants.password);
      curaHomePage.makerarr();
      for(int s=0;s&lt; curaHomePage.array.length;s++){
        curaHomePage.openNext(curaHomePage.array[s]);
        driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
        facilitySelect.click();
  
        driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
          bookAppointmentBtn.click();
      }
      driver.quit();
    }
  }
  </code></pre>