ZBots & ZIPs

Please refer to the online Developer Zone for the latest info, samples, discussions etc.

 

IMPORTANT:

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 Case 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 is real-time about its progress.

 

ZBots come with an execution utility that has the following execution routine:

 

This execution routine can be further enhanced, extended or customized to intercept this execution 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 for the default execution flow of automation scripts to be intercepted in order to perform customized actions. 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

The Developer Zone is a great resource to better understand ZIPs.

 

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)

a. 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>

b. 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)

a. 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>

b. 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

 

Updating Automation Execution Results

ZBots come packaged with a webservices client and have utility methods that you may use within any JAVA based program. This is used to update the results of the execution run directly into the Zephyr server.

 

Zephyr webservice API WSDL can be accessed at http://$ZEPHYR_SERVER:$PORT/flex/services/soap/zephyrsoapservice-v1?wsdl. This WSDL can be used to write a webservices client in any language of choice.

 

The following flow diagram explains all the various moving parts in this process: