There are two ways to do it
Method 1
String menuhoverlink = "//input[xpath]";
String sublink = '//input[xpath]';
Actions builder = new Actions(driver);
builder.moveToElement(driver.findElementBy(menuhoverlink).build.perform();
driver.findElementBy(sublink).click();
Method 2
IWebElement element = driver.findElement(By.XPath("urelementxpath"));
ILocatable hoverItem = (ILocatable)element;
IMouse mouse = ((IHasInputDevices)driver).Mouse;
mouse.MouseMove(hoverItem.Coordinates);
driver.findElement(By.XPath("submenuelementxpath")).Click();
Method 1
String menuhoverlink = "//input[xpath]";
String sublink = '//input[xpath]';
Actions builder = new Actions(driver);
builder.moveToElement(driver.findElementBy(menuhoverlink).build.perform();
driver.findElementBy(sublink).click();
Method 2
IWebElement element = driver.findElement(By.XPath("urelementxpath"));
ILocatable hoverItem = (ILocatable)element;
IMouse mouse = ((IHasInputDevices)driver).Mouse;
mouse.MouseMove(hoverItem.Coordinates);
driver.findElement(By.XPath("submenuelementxpath")).Click();
No comments:
Post a Comment