title: Identify element is not present selenium webdriver javascript
body: <p>I have tried various techniques to assert that an element is not present in Selenium javascript But to no avail, I cant assert of the findElements.length function is the closest I have gotten.</p>
  <pre><code>   const noofElements = driver.findElements(By.css(&quot;#foo&quot;)).then(elements =&gt; console.log(elements.length));
  
     assert.strictEqual(noofElements, 0);  
  </code></pre>
  <p>I can spit out the result of the findelements.length but cant assert against it. I have also tried with .size but that is not an option.</p>