【问题标题】:Selenium test stuck on starting using chromeDriverSelenium 测试卡在开始使用 chromeDriver
【发布时间】:2015-04-08 15:15:23
【问题描述】:

我正在尝试使用 Fluintlenium 编写硒测试,由于某种原因,当我尝试使用 chrome 驱动程序时,它只是在“data;”上打开 chrome;页面并且不会继续到我给它的实际网址。 当我使用 HtmlUnitDriver 时,它会成功运行测试,但使用 chrome 后它会卡住:

在端口 36888 上启动 ChromeDriver 2.15.322448 (****) 只允许本地连接。

我知道它只是一条信息消息,但在那之后它不会继续它只是卡住它没有显示任何错误...

代码是:

public class IntegrationTest extends FluentTest {
public WebDriver driver;
@Override
public WebDriver getDefaultDriver() {
    driver = new ChromeDriver();
    return driver;
}
/**
 * add your integration test here
 */
@Test
public void title_of_bing_should_contain_search_query_name() {
    goTo("http://www.bing.com");
    fill("#sb_form_q").with("FluentLenium");
    submit("#sb_form_go");
    assertThat(title()).contains("FluentLenium");
}

}

我尝试使用 selenium 的 driver.get("url"); 但它也不起作用。

编辑:我如何运行测试? 1. 我刚启动我的 selenium 服务器 2. 我使用 play 所以我运行命令 play test 或 2. 我使用 eclipse junit test runner 来运行单个测试。 两者都不起作用...

【问题讨论】:

    标签: selenium junit selenium-chromedriver fluentlenium


    【解决方案1】:

    这并不意味着 chromedriver 没有启动。这只是一条信息消息,您只能在本地连接到它。

    如果浏览器打开并且没有做任何进一步的事情,在你的情况下,这意味着你没有兼容的 chrome 和 chrome 驱动程序。如果你的 chrome 是最新的,那么 2.13 chromedriver 对你来说太旧了,试试 2.15

    【讨论】:

    • 我用的是最新的chrome,刚刚更新了chrome的驱动,但是还是不行……
    • 在您的日志中我看到您使用的是 2.13?
    • 您使用的是什么硒服务器版本?运行了吗?
    • 2.44 及其运行
    • 好的,那么你最好一步一步告诉你如何开始测试,你正在执行什么步骤(请在主要问题中)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-12
    • 1970-01-01
    • 2014-05-11
    • 1970-01-01
    相关资源
    最近更新 更多