Importing Test Cases From Xray

Applies to Zephyr Scale Server/Data Center 8.6, last modified on October 13, 2021

Zephyr Scale allows you to import test cases from Xray, which can save you lots of redundant recreation effort.

An external script converts the file that contains the Xray test cases into a usable format that can be imported into Zephyr Scale.

Oh, and we have a way to get your attachments into Zephyr Scale, too!

Export Xray test cases

Complete this part of the process in Xray.

  1. Click Tests > Search for Issues in the navigation bar at the top of the page.

  2. Use the filters and/or search bar to filter the Xray test cases you want to export.
    The Project and Issue Type filters are useful to focus the cases you want to export.

    Note:

    Test cases you want to import into Zephyr Scale should follow a one-file-per-Xray-project rule. If it’s too difficult to decide which test cases you want to export, it’s usually no big deal to export most or all of the test cases in a project, even if you will not need all of them in Zephyr Scale. Once the test cases are in Zephyr Scale, you can archive those you don’t need.

  3. Click Export, then click XML in the drop-down list.

    The 'Export' dropdown

    Click the image to enlarge it.

  4. If the file does not automatically download to your computer, click File > Save Page As, and save the file in XML text format.

    The 'Save As' screen

    Click the image to enlarge it.

Convert the XML file

The exported XML file needs to be converted to a format Zephyr Scale knows how to import. You can achieve this using a command-line script.

This part of the process begins in Git.

  1. Clone the Git repository for the file converter.

  2. Click README.md to open the file.

    The cloned Git repository

    Click the image to enlarge it.

  3. Follow the steps in the README file.
    The Xray XML file converts into a new XML file format, which you can import into Zephyr Scale.

Import the converted XML file into Zephyr Scale

Complete this part of the process in the Zephyr Scale project into which you want to import your Xray test cases.

  1. Open your desired project, and ensure you’re in the Tests view.

  2. Click New > Import from File.

    The 'Import from File' command

    Click the image to enlarge it.

    The Import from File wizard appears.

  3. Click Zephyr Scale.

    The 'Import From File' wizard

    Click the image to enlarge it.

    The wizard progresses to the Setup stage.

  4. Upload the converted XML file by dragging and dropping it into the defined area or by clicking Choose the File and selecting it from your local storage.

  5. Complete the field and options in the Settings section.

    • Destination Folder - The folder into which you want to import your test cases.

    • Import Linked Issues - If checked, issues linked as test-case coverage will be imported.

    • Import linked Confluence Pages - If checked, test-case links to Confluence pages will be reserved.

  6. Click Next.
    The wizard progresses to the Field Mapping stage.

  7. Map your fields.
    Unmapped fields will not be created.

    Note: If you intend to migrate test case attachments into Zephyr Scale, you must map the Original issue key field at this time. (Additional steps are explained later on this page.)
  8. Click Next.
    The wizard progresses to the Data Mapping stage.

  9. Map your data type for components, priorities, statuses, labels, etc.
    A message appears if there is no data to map.
    Note the option to automatically create unmapped labels.

  10. Click Import.
    Your test-case information imports to Zephyr Scale. The wizard advances to the Results stage, where import messages and errors appear.

    Note: If the test cases you imported have attachments you also want to migrate into Zephyr Scale, complete the steps in the Importing Test Case Attachments section.

Migrate test case attachments into Zephyr Scale (Optional)

Complete these steps if the Xray test cases you imported into Zephyr Scale contain attachments you also want to migrate. This is accomplished using the Original issue key custom field you mapped in a previous section. The script (below) then reads attachments from Xray test cases (Jira issues) and uploads them to Zephyr Scale using the REST API.

  1. Clone the Git repository for the attachment migrator.

  2. Click README.md to open the file.

  3. Follow the steps in the README file.
    The process is logged on the console, and the images upload to Zephyr Scale.

See Also

Importing Test Cases

Highlight search results