title: if condition on click command in selenium
body: <p>I want to use if condition on <code>element.click()</code> ,
  could any one please help me? 
  There are two different xpaths, if user click 1st xpath that is not present then click on the 2nd element</p>
  
  <pre><code>try{
      WebElement element = driver.findElement(By.xoath("//*[@id='vehicleNum']"));
      if(element.isDisplayed() &amp;&amp; element.isEnabled()){
         element.click(); // here i want if  element.click(); command 
       }
  }catch(Exception e){
       WebElement element_1 = driver.findElement(By.xpath(".//*[@id='service_auto"));
       if(element_1.isDisplayed() &amp;&amp; element_1.isEnabled()){
              element_1.sendKeys("admin");
        }
   }
  </code></pre>