【问题标题】:VisibilityOfElementLocated selenium java not working with phantomjs driverVisibilityOfElementLocated selenium java 不能与 phantomjs 驱动程序一起使用
【发布时间】:2017-03-04 10:24:38
【问题描述】:

我正在使用 java 的 selenium 中的 chrome 驱动程序运行以下代码,它对我来说很好:

WebDriverWait wait = new WebDriverWait(driver, 3);
     wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("buttontofind")));
driver.findElement(By.id("buttontofind")).click();

但是,当我用 phantomjsdriver 更改 chromedriver 并尝试执行它时,我收到以下错误消息:

Expected condition failed: waiting for visibility of element located by By.id: buttontofind (tried for 3 second(s) with 500 MILLISECONDS interval)

【问题讨论】:

    标签: java selenium webdriver phantomjs wait


    【解决方案1】:

    我的问题是:

        driver.findElement(By.id("buttontofind")).sendKeys(Keys.ARROW_DOWN);
    

    没有用 phantomjs 完成足够多的时间,它与 chrome 一起使用似乎更少的箭头...

    【讨论】:

    • 尝试使用headless chrome
    猜你喜欢
    • 2015-07-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-08
    • 1970-01-01
    相关资源
    最近更新 更多