Action Move 适用于:Firefox 版本:48 和 Selenium:3.0.1
有什么想法吗?即使更新浏览器也会出现同样的问题
public void waitAndClickFirstDrivingExperiencesOption(WebElement element) throws Exception {
WebDriverWait wait2 = new WebDriverWait(driver, 30);
Base_Page basePage = new Base_Page(driver);
try {
Boolean elementPresent = wait2.until(ExpectedConditions.elementToBeClickable(element)).isEnabled();
if (elementPresent == true) {
//Provide a slight timeout before clicking on the element
basePage.scrollToElementByLocator(element);
Thread.sleep(1000);
basePage.actionMoveAndClick(element);
System.out.println("Clicked on the first supercars link, using locator: " + element.toString());
}}catch (StaleElementReferenceException elementUpdated) {
element = this.driver.findElement(By.xpath(".//*[@id='prd_listing']/div/li[1]/a"));
Boolean elementPresent = wait2.until(ExpectedConditions.elementToBeClickable(element)).isEnabled();
if (elementPresent == true) {
basePage.scrollToElementByLocator(element);
Thread.sleep(1000);
basePage.actionMoveAndClick(element);
System.out.println("Clicked on the first supercars link (Stale Exception), using locator: " + element.toString());
}
}catch (Exception e) {
System.out.println("Exception! - could not click on the first supercars link, Exception: " + e.toString());
throw (e);
} finally {
}
}
Exception: org.openqa.selenium.UnsupportedCommandException: POST /session/a9265a9c-f425-4875-82d6-401ff75b1a25/moveto did not match a known command Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
最佳答案
它不起作用,因为 Actions API 尚未在 geckodriver/marionette 中实现。
https://github.com/mozilla/geckodriver/issues/233
您可以使用旧的 firefox 驱动程序并在 FF v47 上降级以使其在 firefox 上运行。
关于java - Action 移动不适用于 : Firefox versions:48 and Selenium: 3. 0.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41765556/