ZBot & ZIP Overview

What is a ZBot? 


Zephyr Bots or ZBots are software agents that reside on target automation systems and form the link between the Zephyr Server and the automation tool being used on the target automation system. Based on user action in Test Execution (where the "E" button is clicked and an automation script(s) is kicked off), the Zephyr Server connects with the target ZBot and sends over execution information to execute an individual test script or multiple test scripts.

Installing a ZBot

ZBots must first be installed on the target automation system. ZBots are supported on Windows, MacOS X, Solaris and Linux.

How ZBots Execute

ZBots accept execution instructions from the Zephyr Server. These can be single automation scripts or a batch of them. For batches or groups of test scripts, they have two modes of execution: Sequential and Parallel. The ZBot updates the Zephyr Server in real-time about its progress.
 
ZBots come with an execution utility that has the following execution routine:

  • Accepts commands (i.e. the full command line path of the automation script to be executed) and launches those scripts on the command line
  • Waits for the test script to finish (only in the Sequential mode)
  • Looks at the process exit code and uses it to update execution results
  • Resets itself to accept the next set of instructions

This execution routine can be further enhanced, extended or customized to intercept this flow and can be used to performed customized actions e.g. logging, checkout from repository, perform environment checks and setup, create and remove test data etc. This is done by writing a ZIP.

What is a ZIP? 


A ZIP or a Zephyr Interceptor Program is an extension to the execution utility of a ZBot allowing default execution flow of automation scripts to be intercepted in order to perform customized actions. ZBots comes packaged with a default ZIP which can be intercepted with a partial or full functionality customized. Currently, ZIPs written in JAVA are supported.
 
The following flow shows what the ZBot actions are and <zip> shows where ZIP actions can interface with that flow:
 
Batch Started: Update Batch Status <zip>
          Before Test script execution starts: Update Batch Status <zip>
          Run Test script<zip>
                    In sequential mode, ZBot will wait for each script to finish, gather the process status and update test status in Zephyr Server via a webservice.
                    Exit Status 0 is translated as Pass.
                    Any non-zero values is treated as Fail.
                    In parallel mode, it will launch them all without waiting for it to finish. It also, doesnt update the test execution status.
          Update Test script Execution Result <zip>
          After testcase Executed <zip>
Batch Finished <zip>

Writing a ZIP

Please refer to the Javadocs for writing a ZIP. The online version can be found here. Locally, they can be found in the <zbot_installdir>/zbot/docs

Setup a ZIP

For Windows:
To setup a custom ZIP (created as described in previous section),

  1. Copy the Artifact (either one of the following)
    1. Jar: Copy the jar file to <ZBot_installation_folder>\lib. Modify <ZBot_installation_folder>\conf\wrapper.conf, add following entry
      wrapper.java.classpath.6=..\lib\<your_jar_file_name>
    2. Class: Copy the entire package containing the class file to <ZBot_installation_folder>\plugin.
  2. Update property file: right click on the ZBot and select Edit Properties. This will open zbot.properties in Notepad. Add/Edit following property
    scriptLauncher=<fully_qualified_class_name_of_new_interceptor_program>
  3. Restart ZBot


For Linux/Solaris:
To setup a custom ZIP (created as described in previous section),

  1. Copy the Artifact (either one of the following)
    1. Jar: Copy the jar file to <ZBot_installation_folder>/lib. Modify <ZBot_installation_folder>/conf/wrapper.conf, add following entry
      wrapper.java.classpath.6=../lib/<your_jar_file_name>
    2. Class: Copy the entire package containing the class file to <ZBot_installation_folder>/plugin.
  2. Update property file: Go to <ZBot_installation_folder>/conf/ and open zbot.properties in vi. Add/Edit following property
    scriptLauncher=<fully_qualified_class_name_of_new_interceptor_program>
  3. Restart ZBot


Please use the same version of Zephyr and ZBots, as mixing and matching versions is not supported

For more details, go to developer.yourzephyr.com

Learn about how you can build ZBots and ZIPs with your application. Check out the tools, sample scripts, detailed documentation and share with a community of like-minded developers.