title: Selenium-java: Unable to enter the else If block when Xpath is not displayed
body: <p>I have below piece of code which verifies that If one Xpath is displayed then print some text and if other xpath is displayed then print some text. However, I'm seeing that check is happening for Xpath given in If statement but not skipping and going to Else If. Where I'm doing wrong. Please help!</p>
  
  <pre><code>if(driver.findElement(By.xpath("//*[@id='investmentsthird']/section[1]/section[1]/div/h3")).isDisplayed()) {
      System.out.println("submitted");
  } else if(driver.findElement(By.xpath("//*[@id='investmentsthird']/div[1]/div/div/h4")).isDisplayed()) {
      System.out.println("failed");
  }
  </code></pre>