Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Redirect
delay2
filename
location1558445225

What is 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)ZBots help you automate your test cases: when ZBot is running, you can execute Zephyr Vortex jobs that will add automated test cases to the specified folder and create test cycles on the Test Planning page. When a user runs an automated test case on the Test Execution page, the Zephyr Server connects with to the target ZBot and , sends over execution information to execute an individual test script to it to run one 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? Image Removed

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

...

  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
Note

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., and then retrieves test results to parse and send them to Zephyr:

Image Added


Download ZBot

You can download ZBot directly from Zephyr:

1. Click your username in the top-right corner of the main Zephyr screen and select Download ZBot from the menu:

Image Added

2. In the subsequent dialog, specify a name for your ZBot so that you can easily identify it in Zephyr and click Download:

Image Added


3. Unzip the downloaded archive to some folder on your hard drive:

Image Added

Run ZBot

You can start ZBot right after downloading, there is no need to configure it in any way. It is preconfigured to use your Zephyr URL, username and password, however, you can change these values in the conf\zbot.properties file, if needed.

You start ZBot in different ways, depending on the operating system you use:


Image Added


Windows:

  • Run the zbot_start.bat batch file to start ZBot. To shut it down, just close the terminal.
  • To start ZBot automatically, you can schedule to run the batch file automatically by using Windows Task Scheduler.
  • To start ZBot as a service when your computer starts, just run the zbot_install_service_64.bat file.

Linux:

  • Run zbot_start.sh to start ZBot.
  • Run zbot_stop.sh to stop it.

You can also schedule to start ZBot automatically.

Create a Vortex job

A job is a task with a number of parameters. You use it to automate your test cases. You can create two types of jobs: Automation and Folder Watcher.

  • An Automation job allows you to trigger an execution directly from Zephyr, and once the automation is done, it posts the results to Zephyr.
  • A Folder Watcher job waits for results to appear in the specified results folder, and if any report file is generated, it posts the results to Zephyr.

To create a job,

  1. Switch to Vortex in the pane on the left, click the Automation or Folder Watcher tab if you want to create an Automation or Folder Watcher job respectively, and then click the plus sign:

Image Added

2. In the subsequent window, specify the needed parameters and click Add at the bottom of the page:

Image Added

3. Now when you have a job, you can run it by clicking E in the Execute Job column, or Execute in the top-right corner of the screen.

Image Added

For more information on Vortex, see Zephyr Vortex.

Note

Before running a job, you need to start ZBot. You can execute your jobs only when ZBot is running.

API tokens

Downloading ZBot also creates a Zephyr API token (a token is generated automatically based on the ZBot name) and adds it to the ZBot properties file. You can then use this token to control your ZBot via API. To view the API tokens you have created or to create a new one, click your username in the top-right corner and select API Token from the menu:

Image Added

See Also

Executing Automated Test Cases

Zephyr Vortex

Create and Manage API Tokens in Zephyr