6a) Initial Setup

This page contains basic instructions on installing CWB. If you just want to give it a quick spin without cluttering your Windows installation too much, you should test drive the demo.

Manual installation

The following only applies if you want to manually install CWB.

Java 7 or higher

Make sure you have Java 7 or higher installed and preferably configured in your path.  

IntelliJ IDEA 13 or higher

Enable the cucumber-java plugin.  Recent versions of IntelliJ have it enabled by default.

Maven 3.x

The maven binary should be available in your path.  You can check this by opening a command prompt and running mvn -version.

SAHI 5

This only applies if you want to use CWB for website testing using the SAHI library interface (cwb-sahi).  In most cases, you probably do.

By default SAHI requires the java binary to be available in your path. If you are unable to configure it that way, you can modify the startup scripts in the bin folder of your SAHI installation.

Installation/upgrade instructions

Currently we only prepared a build for Windows 64 bit and Mac OS X, if you need to make it work for another OS and can't figure it out by yourself, contact me or give a callout in the comments.

  • Shutdown any running instance of SAHI
  • Download sahi-5.1-win64.zip or sahi-5.1-mac.zip and unzip in your folder of choice (unzipping will create a base folder called sahi-5.0-xxx)
    • On Windows: Usually we install on the root drive, ending up with c:\sahi-5.0 - rest of the instructions assume this was the case
    • On Mac: Usually we unzip in /Applications and end up with /Applications/sahi-5.0
  • If you had a previous installation of SAHI
    • Compare c:\sahi-5.0\userdata\config\browser_types.xml with the version from your previous installation
      • Note that some browser <options> might be different.  If you did not modify the browser options in your previous installation, simply keep the new ones and only correct the <path> where necessary.
    • Compare c:\sahi-5.0\config\sahi.properties with the version from your previous installation
      • Often the Script execution params are customized, that is all properties starting with script.  Change the values back in the new configuration file if you deem necessary.
    • Copy the certificates from your old installation to the new one
      • Certificates are stored by default in the <sahi-dir>\userdata\certs, though the path could be customized in the sahi.properties file
  • Ensure that you have at least Java 7 configured in your path
    • You can check this by opening a command prompt and executing java -version, the java version line should contain 1.X.* where the X is 7 or more
    • If for some reason you want a specific version of Java to be used, you should modify c:\sahi-5.0\bin\sahi.bat or /Applications/sahi-5.0/bin/sahi.sh
  • Start SAHI by executing c:\sahi-5.0\bin\sahi.bat or /Applications/sahi-5.0/bin/sahi.sh
    • Check that the "browsers not found" list does not contain any of the browsers that it should find.
  • Update any script references (eg Startup folder) to use the new installation

SAHI 5.0 should be running correctly at this point.  To ensure that your CWB projects use the new SAHI at all times, you must configure the path to SAHI in the CWB properties:

  • open ctf.properties file in your project
  • modify the properties in section Sahi configuration (note the optional use of forward slashes in the paths to avoid having to escape values)
    • sahi.baseDir should usually be c:/sahi-5.0
    • sahi.userData should usually be c:/sahi-5.0/userdata
  • modify any local override properties you have configured
    • path to local override properties is defined in the cucumber.xml, default path is ${user.home}/dev-configs/ctf.local.properties

 

On Mac OS X you will usually override the paths to the correct SAHI installation folder in your ${user.home}/dev-configs/*properties:

# Sahi configuration
sahi.baseDir=/Applications/sahi-5.0
sahi.userData=/Applications/sahi-5.0/userdata

 

If you are running automated builds, you have to upgrade SAHI on every build server and ensure that the CWB properties on every server contain the right locations.

Testing my installation

If you want to test our demo, you can find it on this page.

This page contains basic instructions on installing CWB. If you just want to give it a quick spin without cluttering your Windows installation too much, you should test drive the demo.