Question

What is the method used for mouseDown() in Selenium Web Driver? public void mouseDown(String locator)

Was it helpful?

Solution

Simple example:

    driver.get("http://www.sbsddsd.com/");

        driver.manage().timeouts().implicitlyWait(300, TimeUnit.SECONDS);

        Actions act = new Actions(driver);

WebElement parentMenu = driver.findElement(By.xpath("//div[@id='abc')]"));

act.contextClick(parentMenu).build().perform();

        act.sendKeys(Keys.ARROW_DOWN).build().perform();

        act.sendKeys(Keys.ARROW_DOWN).build().perform();

        act.sendKeys(Keys.ENTER).build().perform();

OTHER TIPS

All advanced interaction in Webdriver are handled through Actions class. I am giving you an example below:

Actions builder=new Actions(driver);
builder.moveToElement(WebElement).click();
builder.perform();  
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top