title: How to open a new window while clicking on a link using java
body: <pre><code>if(driver.findElement(By.xpath("xxx")).isDisplayed() != True){
      // if clicked in the above condition is True then it has to be opened in a new window
      driver.findElement(By.xpath("xxx")).click();
  }
  
  else {
      System.out.println("element not present -- so it entered the else loop");
  }
  </code></pre>