title: Get the element availability status in boolean using protractor
body: <p>I am trying to get the element present status of the using 'If' condition but unfortunately i am not able to get the result as either 'true' or 'false' instead i am getting like(when element is available i am getting result as 'true' and when the element is not available i am getting error message like below)</p>
  
  <blockquote>
    <ul>
    <li>Failed: No element found using locator: By(css selector, .alert-message.ng-binding.alert.alert-success)</li>
    </ul>
  </blockquote>
  
  <p>Below is the code i used</p>
  
  <pre><code>describe("test 1", function () {
      it("testing", function () {
          var userCreationSuccessConfirmationMsg = element(by.className('alert-message ng-binding alert alert-success'));
          var userCreationFailureConfirmationMsg = element(by.className('alert-message ng-binding alert alert-danger'));
  
          browser.driver.get(testData.UBETURL);
          login.loginToUbet('sysadmin', 'password');
          console.log('Somesh');
          element(by.linkText('Configuration')).click();
          element(by.linkText('Create New User')).click();
          element.all(by.id('saveUser')).first().click();
          console.log(expect(userCreationSuccessConfirmationMsg.isDisplayed()));
          userCreationSuccessConfirmationMsg.isDisplayed().then(function (status) {
              if (status) {
                  console.log(status);
              } else {
                  console.lgo(status);
              }
          });
      });
  });
  </code></pre>
  
  <p>How to get the element availability status in Boolean using if, please guide me here???</p>