构建selenium-server-standalone可执行jar

时间:2013-03-11 15:32:47

标签: selenium selenium-webdriver

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

我已经按照关于selenium build wiki和自述文件的解释,这里给出的提示: Building the Selenium Server Project

尽管如此,我还没有像selenium-server-standalone-2.25.0.jar这样的jar文件,它可以作为selenium测试的无头浏览器运行和使用。

...所以我试图用我的补丁重新创建selenium-server-standalone-2.xx.jar文件,然后用它来运行我的无头测试。

任何人都可以向我解释如何做到这一点?谢谢!

2 个答案:

答案 0 :(得分:4)

我找到的最好方法是:

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

答案 1 :(得分:0)

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

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

另外,您可以参考有关构建selenium的官方文档。 https://code.google.com/p/selenium/wiki/BuildingWebDriver#Building_Selenium_Server