title: How to mouse over and click on " Mobiles section"
body: <p><a href="https://i.stack.imgur.com/2R05M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2R05M.png" alt="enter image description here"></a></p>
  
  <p>To move to Electronics menu:</p>
  
  <pre><code>Actions action = new Actions(driver);
  action.moveToElement(driver.findElement(By.xpath("//*[@id='container']/div/header/div[2]/div/ul/li[1]/a/span[text()='Electronics']"))).build().perform();
  </code></pre>
  
  <p>To move Mobile Menu:</p>
  
  <pre><code>//WebElement mobile = (new WebDriverWait(driver,2)).until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id='container']/div/header/div[2]/div/ul/li[1]/ul/li/ul/li[1]/ul/li[1]/a/span[1][text]()='Mobiles')")));
  </code></pre>
  
  <p>To click on the Mobiles:</p>
  
  <pre><code>// action.moveToElement(driver.findElement(By.xpath("//*[@id='container']/div/header/div[2]/div/ul/li[1]/ul/li/ul/li[1]/ul/li[1]/a/span[1][text]()='Mobiles')"))).click();
  
  WebElement mobile=driver.findElement(By.xpath("html/body/div[1]/div/header/div[2]/div/ul/li[1]/ul/li/ul/li[1]/ul/li[1]/a/span[1][text]()='Mobiles')"));
  mobile.click();
  </code></pre>
  
  <p>Tried the above code but didn't work error message displayed:</p>
  
  <blockquote>
    <p>Xpath does not exist</p>
  </blockquote>