-
Notifications
You must be signed in to change notification settings - Fork 7
Installing
This installation guide assumes a POSIX-compliant OS, such as Mac OS X or Linux. If you're under Windows, see below.
Watai runs as a Node.js module. You will therefore need the Node runtime (≥ 0.8) and package manager (NPM ≥ 2).
If you’re under OSX and have Homebrew:
brew install node
Otherwise, download the Node+NPM package for your environment if you don't already have it.
Watai uses Selenium-WebDriver to automate browsers. You will therefore need a Selenium standalone server to send commands to the browsers.
npm install --global selenium-server
You will need a Java runtime (≥ 1.5) to run the server. If you don't already have one, install it and run:
selenium &
That's all the dependencies you'll need if you want to test with Firefox.
If you want to test with Chrome (or with other browsers), you will have to install some additional software.
This is completely optional, and you will be operational faster if you do the tutorial with Firefox. The testing itself will be a bit slower, but you may come back to add Chrome later on if you like Watai.
npm install --global watai
NPM will automatically create the watai
alias for you. If you decide you don’t want to use Watai later on, simply npm uninstall --global
it.
If you want to use Watai only in a specific project.
cd path/to/your/node/project
npm install --save-dev watai
alias watai="$(pwd)/node_modules/.bin/watai"
This will create a node_modules
folder with all dependencies in the current directory.
If your proxy configuration prevents you from using npm install
properly (i.e. you get ERRTIMEOUT
errors), download the latest Watai with NPM dependencies package from the Releases tab, unzip it and:
alias watai='node path/to/unzipped/folder/src'
Note the /src
at the end!
Follow the main instructions above for Node and Selenium server.
Once Node is installed, if you don’t have admin privileges, you might have to define PATH
as a user environment variable and set it to <install_drive>:\Program Files\nodejs
.
Once you have both Node and a Selenium server, you can consider installing Watai itself.
npm install --global watai
doskey watai=node "%APPDATA%\npm\node_modules\watai\src" $*
Note the \src $*
at the end!
If your proxy configuration prevents you from using npm install
properly (i.e. you get ERRTIMEOUT
errors), download the latest Watai with NPM dependencies package from the Releases tab, unzip it and:
doskey watai=node path\to\unzipped\folder\src $*
Note the \src $*
at the end!
Let’s make sure you’re fully ready to use Watai by typing:
watai --installed