title: TypeError: driver.isElementPresent is not a function
body: <p>I am attempting to write a node function that logs into a website and  am having trouble getting it to work.  I am trying to wait for the page to load using the <code>isElementPresent</code> function, referenced in <a href="https://stackoverflow.com/questions/25753014/selenium-webdriver-wait-till-element-is-displayed">this post</a> but it doesn't seem to be working.</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>const webdriver = require('selenium-webdriver')
  const By = webdriver.By
  
  var username = ''
  var password = ''
  var timeout = 5000
  
  function FacebookLogin(username, password) {
  
      var driver = new webdriver.Builder()
          .withCapabilities(webdriver.Capabilities.chrome())
          .build()
  
      driver.get('http://www.facebook.com')
  
      driver.wait(function() {
          return driver.isElementPresent(By.id('email'))
      }, timeout)
  
      var user = driver.findElement(By.id('email'))
      user.sendKeys(username)
  
      var pass = driver.findElement(By.id('pass'))
      pass.sendKeys(password)
  
      pass.submit()
      driver.sleep(5000)
      driver.quit()
  }
  
  FacebookLogin(username, password)
  </code></pre>
  
  <p>When I run the function though I receive the error <code>TypeError: driver.isElementPresent is not a function</code>.  What is going on here and what am I missing?</p>