【问题标题】:Build selenium-server-standalone executable jar构建 selenium-server-standalone 可执行 jar
【发布时间】:2016-09-29 23:10:21
【问题描述】:

我在 HtmlUnitDriver.java 文件中做了一个补丁,如下所述: Is it possible to ignore JavaScript exceptions when working with WebDriver (HtmlUnit, Ruby bindings)

我遵循了 selenium 构建 wiki 和自述文件中的说明,以及此处给出的提示: Building the Selenium Server Project

不过,我没有像 selenium-server-standalone-2.25.0.jar 这样的 jar 文件可以运行并用作 selenium 测试的无头浏览器。

...所以我正在尝试使用我的补丁重新创建 selenium-server-standalone-2.xx.jar 文件,并使用它来运行我的无头测试。

谁能向我解释如何做到这一点?谢谢!

【问题讨论】:

    标签: selenium selenium-webdriver


    【解决方案1】:

    我发现最好的方法是:

    go //java/server/src/org/openqa/selenium/remote/server:server:uber //java/client/src/org/openqa/selenium:client-combined:uber

    这将为 selenium 服务器创建一个 jar

    然后运行go release

    生成的 .jar 应在 selenium 源文件夹的 build\dist 文件夹中找到。 (例如./build/java/server/src/org/openqa/grid/selenium/selenium-standalone.jar

    另见https://github.com/SeleniumHQ/selenium/wiki/Building-WebDriver#tips

    【讨论】:

      【解决方案2】:

      这是 selenium 独立服务器的分步构建指南。 selenium 项目的构建过程对于新手来说可能不是那么困难,所以我推荐这个关于如何创建一个可运行的独立 jar 的详细指南。

      http://shengwangi.blogspot.com/2014/08/how-to-build-selenium-from-source.html

      另外你也可以参考官方文档 build selenium。 https://code.google.com/p/selenium/wiki/BuildingWebDriver#Building_Selenium_Server

      【讨论】:

      • 除了链接,请在您的答案中添加相关部分。
      猜你喜欢
      • 1970-01-01
      • 2015-02-02
      • 2015-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-21
      相关资源
      最近更新 更多