Showing posts with label mouse hover. Show all posts
Showing posts with label mouse hover. Show all posts

Saturday, September 1, 2012

How to mouse hover using WebDriver Backed selenium?

How to mouse hover using WebDriver Backed selenium?

Create a webdriverbackedselenium object and mouse move to the specific id and click on the on any specific id.

Below is the small snippet code for mouse move or mouse hover using webdriver backed selenium.


Using WebDriverBacked Selenium:

        WebDriverBackedSelenium seleniumDriver = new WebDriverBackedSelenium(driver,"URL");
       
        seleniumDriver.mouseMove("Specify id ");
        seleniumDriver.click("Specify id");


how to mouse hover on any element using webdriver

how to mouse hover on any element using webdriver?

Mouse over using WebDriver little different. And also the given solution may not work with the latest versions of FF 12+. We need to wait for the latest version of the selenium jar.


//driver = new InternetExplorerDriver();
// driver = new FirefoxDriver();
driver.get("URL");


Using Actions:

        Actions builder = new Actions(driver);
        WebElement ele = driver.findElement(By.xpath("Specify xpath"));
        builder.moveToElement(ele).build().perform();
        WebElement ele2 = driver.findElement(By.xpath("Specify xpath"));
        ele2.click();