Mouse Hover in selenium



public static void main(String[] args) throws InterruptedException {

WebDriver driver = new FirefoxDriver();
driver.get("http://www.timeanddate.com/");
driver.manage().window().maximize();
WebElement menu = driver.findElement(By.xpath("//*[@id='nav']/ul/li[3]/a"));
Actions action = new Actions(driver);
action.moveToElement(menu).perform();
WebElement submenu = driver.findElement(By.xpath("//*[@id='nav']/ul/li[3]/ul/li[4]/a"));
action.moveToElement(submenu).click().perform();

Thread.sleep(5000);
driver.close();
}

For any queries, ContactUs