title: How to find if one of the element is present after the page is displayed
body: <p>The protractor has to verify whether the error message is present in the page. So the error message can be either in "alert-message" class or in "fail-heading" class.</p>
  
  <p>If i do like below it is successful only if the alert-message className is displayed. But sometimes i get the className as "fail-heading". </p>
  
  <pre><code>var waitforele_confirmation = by.className('alert-message');
  browser.wait(function(){return browser.driver.isElementPresent(waitforele_confirmation)}, 60000);
  expect(browser.driver.isElementPresent(waitforele_confirmation)).toBeTruthy();
  </code></pre>
  
  <p>So i want to dynamically check which element is present after the page is loaded. Also i want to use the browser.wait function when waiting for each element. I just did the below pseudo code just to understand.</p>
  
  <pre><code>while (i&lt;120 and !found)
  {
      int i=0;
      if (element(by.className('alert-message')).isPresent())
      {
      found = true;
      }
      else if (element(by.className('fail-heading')).isPresent())
      {
      found = true;
      }
      else
      {
      browser.sleep(500);
      }
      i++;
  }
  </code></pre>
  
  <p>Can someone convert the pseudo code in protractor pls?</p>