|
BuildingWebDriver
Instructions on how to build WebDriver
WebDriver Building WebDriverPrerequisitesFor all versions of WebDriver:
In addition, the InternetExplorerDriver needs some additional components and can only be fully built on Windows
The build is based on rake, a well-known Ruby build tool. Provided you have all the gems required you can use that for building the project, though this isn't the recommended way to build. The bundled JRuby jar, invoked through the "go" wrapper, includes all dependencies without requiring any extra setup. BuildingThe build script will determine which parts of WebDriver will be built. When there are native components that must be built, the build file will attempt to construct them before falling back to prebuilt binaries. Assuming you have checked out the source to $WEBDRIVER_HOME, now: cd $WEBDRIVER_HOME # Where the top level Rakefile is kept go # or, on a UNIX system: ./go This will not only compile the source, but will also run any tests which need to be run. If these all pass, then you have successfully built WebDriver! There are more detailed instructions about how the build system works in the CrazyFunBuild section. By default, the output of the build is somewhat terse. A log of the java compilation stages is kept in "build/build_log.xml". You can also get more verbose output by adding "log=true" to the build targets. eg: ./go //java/client/test/org/openqa/selenium/support:test:run log=true Finally, you can get even more verbose logging by modifying the Rakefile and commenting out the line that reads: verbose false The test logs are kept in the "build/test_logs" folder. TipsBuilding Selenium ServerYou'll get a long way with just: go //java/server/src/org/openqa/selenium/remote/server:server:uber //java/client/src/org/openqa/selenium:client-combined:project That'll build the standalone "selenium server" jar and the client library too. The build output will tell you where the output files are being placed. You can replace that second target with: //java/client/src/org/openqa/selenium:client-combined:uber The "uber" implicit targets build a single "uber jar" containing all the compiled java from the project, as well as all third party dependencies. The "project" implicit target is similar, but excludes third party dependencies. Sources//java/server/src/org/openqa/grid/selenium:selenium:project-srcs will give you some sources. Building the Android driverSee Android Wiki Useful TargetsAll of these should be run using the "go" executable. For everything:
For Java:
Useful parameters:
For Javascript:
Common ProblemsNothing CompilesMake sure that you've got the JAVA_HOME environment setting properly set up. In addition, make sure that you can execute "rake" "java", "jar" and "javac" from the command line. If you're on Windows, you'll also need to be able to execute "devenv". You may need to install a JDK. If a C++ component doesn't build properly on Windows, make sure that you are actually using the VS2010 version of msbuild (this might not be the case, even if you're in a VS2010 Command Prompt) All Firefox Tests FailOccasionally we change the protocol of how the java code in the Firefox driver talks to the extension. The main reason why all the firefox tests fail is because the user has installed a profile called "WebDriver". This should be deleted. The following trouble-shooting steps might be useful:
Although it was necessary in the early days of webdriver development, it is now no longer necessary to install the webdriver extension manually. Indeed, doing so is more likely to be the root of hard to track down errors. It is strongly recommended that you do not install the firefox extension manually The Build Works, but It's Very SlowThere have been reports of problems involving slow builds. Every test that runs does a DNS lookup to determine an alternative host name. If your network is not configured correctly, then this lookup might be very slow. To rectify this, modify the getAlternateHostName method in org.openqa.selenium.environment.webserver.Jetty7AppServer and hard code it to return a string that resolves to your machine that isn't "localhost" I've Followed the Steps Above and All the Firefox Tests Still FailOther things to check:
When do the prebuilds need re-building?
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||