无法使用Arquillian Drone连接到Firefox

时间:2017-05-18 02:02:52

标签: java selenium jboss-arquillian arquillian-drone

我正在关注位于here的文档。我的目标是将Drone集成到我的客户端测试中。

以下是我的代码示例:

@Test
@RunAsClient
public void testSomething(@Drone final FirefoxDriver driver) throws Exception {
    final String url = "www.google.com";
    System.out.println("### the endpoint is :: " + url);

    driver.get(url);
    driver.wait(5000);
    final String pageSource = driver.getPageSource();
    System.out.println("### source is :: " + pageSource);

}

当我运行Arquillain测试时,firefox窗口会打开,但它只是坐在那里。过了一段时间,我的测试结束了,并给了我以下一塌糊涂:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
*** Blocklist::_preloadBlocklistFile: blocklist is disabled
JavaScript error: chrome://browser/content/urlbarBindings.xml, line 677: aUrl is undefined
JavaScript error: chrome://browser/content/urlbarBindings.xml, line 677: aUrl is undefined

我在Firefox 32和45上试过这个,结果相同。我对硒的依赖结构如下:

selenium-firefox-driver:2.29.0

selenium-remote-driver:2.29.0

的Arquillian-无人驾驶的webdriver-depchain:1.1.1.Final

我在这里缺少什么?

1 个答案:

答案 0 :(得分:3)

Firefox 32,45很老了。

你似乎指的是Arquillian Drone的一些旧文档。

查看此新文档 - http://arquillian.org/arquillian-extension-drone/

检查我的pom哪个效果很好并相应地调整你的pom。

<properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <version.org.jboss.arquillian>1.1.12.Final</version.org.jboss.arquillian>
        <version.org.jboss.arquillian.drone>2.1.0.Alpha2</version.org.jboss.arquillian.drone>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.jboss.arquillian.graphene</groupId>
            <artifactId>graphene-webdriver</artifactId>
            <version>2.2.0</version>
            <type>pom</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.testng</groupId>
            <artifactId>arquillian-testng-standalone</artifactId>
            <version>1.1.13.Final</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-api</artifactId>
            <version>3.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-support</artifactId>
            <version>3.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.extension</groupId>
            <artifactId>arquillian-drone-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.graphene</groupId>
            <artifactId>graphene-webdriver-api</artifactId>
            <version>2.2.0</version>
        </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <!-- Arquillian Core dependencies -->
            <dependency>
                <groupId>org.jboss.arquillian</groupId>
                <artifactId>arquillian-bom</artifactId>
                <version>${version.org.jboss.arquillian}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- Arquillian Drone dependencies and WebDriver/Selenium dependencies -->
            <dependency>
                <groupId>org.jboss.arquillian.extension</groupId>
                <artifactId>arquillian-drone-bom</artifactId>
                <version>${version.org.jboss.arquillian.drone}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>