Contact Us 1-800-596-4880

Installing BAT

The Blackbox Automated Testing (BAT) CLI wrapper is a command line wrapper that you install to execute API tests.

Prerequisite for Linux and MacOS Systems

Before installing the BAT CLI, ensure that AdoptOpenJDK’s OpenJDK 8 is installed on your system.

Prerequisites for Windows 10 Systems

  1. Install Windows Subsystem for Linux (WSL)

  2. Install Java 8, curl, and the application "unzip" into the Linux distribution that you installed in your WSL.

  3. Ensure that the JAVA_HOME variable in your environment is set to the location of your Java installation.

  4. Add the bat executable to your PATH environment variable:

    1. Open the ~/.bashrc file (if you are using bash) or the ~/.zshrc file (if you are using zsh) for editing. For example, to use the vi editor, enter either of these commands:

      vi ~/.bashrc

      vi ~/.zshrc

    2. Add the following line to the end of the file and then save the file:

      export PATH=$PATH:~/.bat/bat/bin

Install BAT

You can install BAT CLI on Linux, MacOS, and Windows.

Linux and MacOS Systems

  1. Ensure that the user under which you are installing has write and execute permissions for the directory into which you plan to install BAT CLI and to /usr/local/bin.

  2. Run the following command to install BAT CLI:

    curl -o- 'https://s3.amazonaws.com/bat-wrapper/install.sh' | bash

    This installs BAT CLI into the $HOME/.bat/bat/bin directory. The installation script automatically adds a bat file to the /usr/local/bin directory that points to the actual BAT CLI installation directory. If this does not work, you can manually add $HOME/.bat/bat/bin to your shell environment’s path to execute BAT CLI or rerun the installation under a user with write permission for /usr/local/bin.

  3. Run the command bat -version to verify that BAT CLI is installed.

Windows

  1. Click here to automatically download the ZIP file of the BAT wrapper for Windows.

  2. Unzip the ZIP file to install BAT CLI in your Windows environment.

  3. Run the command bat -version to verify that BAT CLI is installed.

What to Do Next

You can now start creating a test suite.