我正在使用此代码点击按钮
driver.findElement(By.linkText("Sign up")).click();
我尝试使用:
new WebDriverWait(driver,30).until(ExpectedConditions.elementToBeClickable(By.linkText("Sign up")))
但它不起作用。
答案 0 :(得分:0)
尝试此示例,因为您没有提及网址:
WebDriver driver =new FirefoxDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://only-testing-blog.blogspot.in/2014/09/selectable.html");
WebElement ele = driver.findElement(By.xpath("//button[contains(.,'Double-Click Me To See Alert')]"));
//To generate double click action on "Double-Click Me To See Alert" button.
Actions action = new Actions(driver);
action.doubleClick(ele);
action.perform();
浏览此网址以了解详情: