title: Hover over menu and select sub menu in java Selenium
body: <p>I am trying to hover over a main menu and select a submenu using java selenium, i got it to hover over the menu but cant select the sub menu, if i try to find by linktext i always get the error "does not exist " if i use xpath the says build successful but does not open up the new page.  Here is my code for it so far</p>
  
  <pre><code>System.setProperty("webdriver.chrome.driver","C:/Driver/chromedriver.exe");      
      WebDriver webDriver = new ChromeDriver();       
      webDriver.manage().window().maximize();
      webDriver.navigate().to("https://www.skiutah.com");
  
      String NavTo = "DEALS";
      String pathx = "//*[@id=\"top_menu\"]/ul/li[4]/ul/li[1]/ul/li[2]/a" ;
      WebElement element = webDriver.findElement(By.linkText(NavTo));
      WebElement el = webDriver.findElement(By.xpath(pathx));
      Actions action = new Actions(webDriver);
      action.moveToElement(element).perform();
      action.moveToElement(el).click();
  </code></pre>