动作移动dosnt适用于:Firefox版本:48和Selenium:3.0.1

时间:2017-01-20 14:06:50

标签: java selenium selenium-webdriver webdriver automated-tests

动作移动dosnt适用于: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 {
        }
    }
  

异常:org.openqa.selenium.UnsupportedCommandException:POST   / session / a9265a9c-f425-4875-82d6-401ff75b1a25 / moveto不符合   已知命令构建信息:版本:' 3.0.1',修订版:' 1969d75',时间:   ' 2016-10-18 09:48:19 -0700'

1 个答案:

答案 0 :(得分:4)

它不起作用,因为在geckodriver / marionette中尚未实现Actions API。

https://github.com/mozilla/geckodriver/issues/233

您可以使用旧的firefoxdriver并在FF v47上降级以使其在Firefox上运行。