title: MouseHover and Click events in Selenium WebDriver
body: <p>I am trying to do the following events using <code>Selenium</code> <code>WebDriver</code></p>
  
  <ul>
  <li><code>Mousehover</code> to Create Application and then</li>
  <li><code>Click</code> on the New Application</li>
  </ul>
  
  <p>I have following code , the below is a <code>function</code></p>
  
  <pre><code>public Boolean entermousehoverandclick(String mousehovervalue , String clickvalue)
  {
      Boolean status = true;
      try
      {
          WebElement create = driver.findElement(By.linkText(mousehovervalue));
  
          Thread.sleep(2000);
  
          Actions action = new Actions(driver);
          action.moveToElement(create).pause(1000).build().perform();
  
          Thread.sleep(1000);
  
          driver.findElement(By.linkText(clickvalue));
  
          Thread.sleep(1000);
      }
      catch(Exception e)
      {
          status = false;
      }
      return status;
  }
  </code></pre>
  
  <p>I am calling the above function in the testcase as below</p>
  
  <pre><code>if(fn.entermousehoverandclick("Create", "New Application"))
     {
     System.out.println("Successfully clicked on create application");
     }
    else
     {
    System.out.println("Error in clicking create application");                   
     }
  </code></pre>
  
  <p>While running the test case, the script clicks on the create option but it is not selecting the new application option.</p>
  
  <p>Could you please help, thanks in advance.</p>