title: Check if element exists - selenium / javascript / node-js
body: <p>I'm trying to check if an element exists before I can execute this line:</p>
  
  <p><code>driver.findElement(webdriver.By.id('test'));</code></p>
  
  <p>This throws an error "no such element" if the id <code>test</code> doesn't exist in the document, even in a <code>try</code>-block.
  I've found answers for Java, where you can check if the size is 0,  but in node-js this throws an error before I can check the size.</p>
  
  <p><code>throw error;
              ^
  NoSuchElementError: no such element
  </code></p>