Selenium Web Driver中mouseDown()的使用方法是什么? public void mouseDown(String locator)
答案 0 :(得分:0)
Webdriver中的所有高级交互都是通过Actions类处理的。我在下面给你举个例子:
Actions builder=new Actions(driver);
builder.moveToElement(WebElement).click();
builder.perform();
答案 1 :(得分:0)
简单示例:
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();