title: i want to write in textbox if it is display on page and click on next button if it is not display on the page then directly click on next button
body: <pre><code>if(!driver.findElement(By.id("pt1:r1:0:r1:2:r1:0:it1::content")).isEnabled())
  {   
      System.out.println("IS NOT DISPLAYED"); // if text box is display
      driver.findElement(By.id("pt1:r1:0:r1:2:next")).click();
  }
  else if(driver.findElement(By.id("pt1:r1:0:r1:2:r1:0:it1::content")).isEnabled())
  {           
      System.out.println("IS DISPLAYED"); // if text box is not display
      driver.findElement(By.id("pt1:r1:0:r1:2:r1:0:it1::content")).sendkey("ABCXYZ");
      driver.findElement(By.id("pt1:r1:0:r1:2:next")).click();
  }
  </code></pre>
  
  <p>I have tried with try and catch block its working but it takes time to execute script.</p>