-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Chromedriver
Since v0.6.0 chromedriver
is distributed with node-webkit binaries.
From chromedriver project home page:
WebDriver is an open source tool for automated testing of webapps across many browsers. It provides capabilities for navigating to web pages, user input, JavaScript execution, and more. ChromeDriver is a standalone server which implements WebDriver's wire protocol for Chromium. It is being developed by members of the Chromium and WebDriver teams.
You can use it with tools like selenium.
The only difference of the binary files from the official one is: chromedriver2_server
will search for node-webkit binaries (nw, nw.exe) in the same directory (on OSX it's the same directory with node-webkit.app
).
The following workflow uses wd to drive the tests:
- Download
chromedriver2
(see links below) and place it under the same dir that contains the node-webkit binaries (nw
,nw.exe
, ornode-webkit.app
on OSX) - Download the Selenium Server Standalone jar and place it in the same dir as
chromedriver2
- Install
wd
in your project'snode_modules/
:
$ npm install wd
- Start Selenium:
$ java -jar selenium-server-standalone-VERSION.jar -Dwebdriver.chrome.driver=./chromedriver2_server
- Drive Selenium as per wd's instructions, for example:
$ (your_project_path)/node_modules/.bin/wd shell
(wd): x = wd.remote()
(wd): x.init({ browserName: "chrome" })
(wd): x.get("http://google.com")
- At this point you should have a node-webkit window open showing Google's homepage
As you may have found from trying to run node-webkit in later versions of Ubuntu, you will probably find this won't work due to lacking libudev.so.0. You can work around this reasonably easily.
- Rename
nw
to something else (I chosemyapp-bin
) - this is because ChromeDriver has hard-coded the executable to nw. - Create a new executable file called
nw
with the instructions found in the Wiki for the libudev.so.0 hack. REMEMBER TO CREATE A SIMLINK IN THIS DIRECTORY!!!
You should find this now works in Ubuntu 13.x
https://s3.amazonaws.com/node-webkit/v0.8.0/chromedriver2-nw-v0.8.0-linux-ia32.tar.gz
https://s3.amazonaws.com/node-webkit/v0.8.0/chromedriver2-nw-v0.8.0-linux-x64.tar.gz
https://s3.amazonaws.com/node-webkit/v0.8.0/chromedriver2-nw-v0.8.0-osx-ia32.zip
https://s3.amazonaws.com/node-webkit/v0.8.0/chromedriver2-nw-v0.8.0-win-ia32.zip
https://s3.amazonaws.com/node-webkit/v0.7.0/chromedriver2-nw-v0.7-win-ia32.zip
https://s3.amazonaws.com/node-webkit/v0.7.0/chromedriver2-nw-v0.7-osx-ia32.zip
https://s3.amazonaws.com/node-webkit/v0.7.0/chromedriver2-nw-v0.7-linux-ia32.tar.gz
https://s3.amazonaws.com/node-webkit/v0.7.0/chromedriver2-nw-v0.7-linux-x64.tar.gz
https://s3.amazonaws.com/node-webkit/v0.6.0/chromedriver2-nw-v0.6.0-win-ia32.zip
https://s3.amazonaws.com/node-webkit/v0.6.0/chromedriver2-nw-v0.6.0-linux-ia32.tar.gz
https://s3.amazonaws.com/node-webkit/v0.6.0/chromedriver2-nw-v0.6.0-linux-x64.tar.gz
https://s3.amazonaws.com/node-webkit/v0.6.0/chromedriver2-nw-v0.6.0-osx-ia32.zip