title: Fail Webdriver test if element is present
body: <p>I'm new to Webdriver and I'm wondering how do I make my test case fail if an element is present. Using the following code I can send an output that if the element id <code>errorMessages</code> is present an output will be displayed. Is there anyway I can make the test fail also?</p>
  
  <pre><code>if (driver.findElements(By.id("errorMessages")).size() != 0) {
      System.out.println("Error..Warning Subscriber already exists ");
  }
  </code></pre>