【问题标题】:How can I run HTML Selenese Tests using Selenium 2.0 and Maven?如何使用 Selenium 2.0 和 Maven 运行 HTML Selenese 测试?
【发布时间】:2011-05-27 19:33:04
【问题描述】:

我有一系列可以使用 selenese 目标 selenium-maven-plugin(1.1 版)运行的 HTML 测试。我能够为 IE 运行它。但是,这不适用于 Firefox 4。我不断打开一个空白的 Firefox 窗口,服务器将挂在那里。我相信我已经将问题缩小到 Selenium-maven-plugin 使用旧的 Selenium 1.0 Core,它在 Firefox 4 中无法正常运行。

我想知道是否有某种方法可以使用 Maven 和 Selenium 2.0 来运行这些 HTML 测试。以下是我的 POM 文件的 sn-p。

     ...    
     <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>selenium-maven-plugin</artifactId>
            <version>1.1</version>
            <configuration>
                <browser>*iexploreproxy</browser>
                <suite>src/test/selenium/html/suite.html</suite>
                <startURL>http://localhost:5555/</startURL>
                <port>5555</port>
            </configuration>
            <executions>
                <execution>
                    <id>Run-Selenese-Scripts</id>
                    <phase>integration-test</phase>
                    <goals>
                        <goal>selenese</goal>
                    </goals>
                    <configuration>
                        <port>5555</port>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
    ...

如果有任何其他方式来运行我可能错过的 HTML 套件(除了 Selenium IDE),请分享。

谢谢,

胡安

【问题讨论】:

    标签: maven selenium selenium-rc selenium-webdriver


    【解决方案1】:

    我昨天在 OSX 上遇到了这个确切的问题。尝试使用 firefox 4 - 打开一个空白的 firefox 窗口并且 selenium-server 没有检测到它。解决这个问题的唯一版本(无论如何在 OSX 上)是 2.0b3。

    我在 github 上有一个升级到 2.0b3 的当前主干的分支:https://github.com/thelmstedt/selenium-maven-plugin。 YMMV

    实际上有一种方法可以在 selenium-maven-plugin 插件声明中覆盖 selenium 版本:请参阅this jira issue 以获取故障排除。

    但是 selenium 人最近更改了他们的 maven 包装,我无法使用它来覆盖到最新的 2.0b3 依赖项。将上传的version 2.0b12.0b3 进行比较。现在声明对 selenium 的依赖的正确方法是使用 &lt;type&gt;pom&lt;/type&gt;。如果事实证明我错了,我会很高兴。

    【讨论】:

    • 嗨,蒂姆,我尝试按照您提供的 JIRA 中的说明覆盖 selenium 服务器,效果很好。我设法越过空白屏幕并进入 Selenium Test Runner。但是,测试运行程序不会自动运行我的套件。我会进一步研究这个。我还将研究使用分叉插件。非常感谢您的建议。
    • 嗨,蒂姆,您对需要 POM 类型来覆盖 maven 插件使用的现有 Selenium 的 2.0b3 工件是正确的。我相信在使用 POM 覆盖时它仍然有效,因为 JAR 包含在插件的类领域中。请参阅下面的列表。
    • [DEBUG] 包括:org.seleniumhq.selenium:selenium-server:jar:2.0b3
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-04
    • 2015-08-19
    • 2014-04-23
    相关资源
    最近更新 更多