What you'll learn

  • How to export test cases from qTest manager
  • Use a script to convert the exported Excel test cases to an Xray compatible CSV file
  • Import different test cases (with different fields and options)
  • Validate that the test cases were imported to Xray

Source-code for this tutorial

  • All examples are available on GitHub

Overview

This tutorial explains how to export test cases from qTest manager and import them into Xray.

qTest manager is a test management tool available in the cloud. In this tutorial, you will learn how to export the test cases from qTest manager in an Excel format, how to use a script (available in GitHub) to convert the Excel file into a compatible CSV so that it can be imported into Xray using the Test Case Importer.

This tutorial will provide different examples of exporting and importing test cases from qTest manager into Xray.

Features and Limitations

Below is a list of the support features and current limitations.

Migration from qTest manager is limited by the information we can export from qTest manager and how it can be mapped to Xray entities.

Supported FeaturesUnsupported
  • Test and Test steps
  • Test case attachments
  • Data sets
  • Test Cycles
  • Test Modules
  • Test Suite
  • Test Plans
  • Preconditions
  • Defects and Requirements


How it works

qTest is web based application that allows the users to specify and organize test cases into modules. qTest has test cycles, test suites and plans; these concepts help the organization and execution of test cases. Depending on your testing goals, you can use them or not.

qTest can create test cases step-by-step, and choose the type of the test case between manual, automated, performance or Scenario (used for a BDD approach). All of the test types can define multiple steps with step description and expected result; in these steps, you can define a data set and use variables or call other test steps. All of the above types can use steps to define the tests and integrate with automation using the qTest Automation module.

In qTest, to execute tests, you need to associate the executions to a test suite under a release in a test cycle.

qTest manager uses different entities to describe tests and the flow, so we have summed up into the next table the existing mappings between qTest manager and Xray.

qTestXrayComments
Test CaseTest

All three types of tests from qTest are imported into Xray.

Notice that for the Server version of Xray we only create the Tests corresponding to the test cases in qTest. Preconditions, if needed, must be create separately. 




Prerequisites


We will use the Test Case Importer tool for these examples, which is present when you install Xray in your Jira instance.

 We will need:

  • Access to qTest instance to export test cases in Excel format
  • Access and usage of scripts to convert qTest Excel test cases to CSV Xray import files
  • Access to a Jira instance with Xray installed




Examples

In each example, we will show how we obtained the Excel file from qTest, made the files available in GitHub, how to use the scripts to convert the Excel files into compatible CSV files, and finally, how to import the CSV files into Xray.

We will showcase different possibilities when exporting test cases from qTest, using a combination of fields and possibilities that should cover most usages.

All of the examples in this tutorial have an Excel file exported from qTest, a CSV file with the definition of the test cases to import, and a configuration file that will configure all associations and fields for the importation to be successful.


Export to Excel from qTest and Import into Xray

In qTest when you choose to export using Excel format, it will export the selected test cases. In this example, we are exporting all test cases.

To export from qTest we are using the Test Case Detail Report under Export Test Case Reports option in the left upper menu entry in qTest.


Make sure that you select all test case fields to be imported and to choose the No Cell Merging option on the pop up window.


Looking into more detail on what we have in qTest, we can see that we have defined several test cases, covering the different types available in qTest. One scenario test case with one scenario in Gherkin and several step-by-step test cases, using a dataset, re-using test cases, and using all the variations in the steps available (tables, images, different formats, etc.). All of the details of each case is described below.

The file generated by qTest has the following content:


To import into Xray, we created one script to convert this Excel file into a CSV-compatible file to be imported into Xray.
The script will parse the Excel file and create a CSV file that can be imported into Xray. To execute the script, use the following command:

python3 qtest2Xray.py -i qTest-Regression-TestCase.xls -o qTest-Regression-TestCase.csv


The output file has all the test steps and, if you have used a precondition in qTest, it will create a precondition in Xray and link it to the test.

comic_estore.csv
Issue ID,Issue Key,Test Summary,Test Priority,Action,Data,Result,Description
1,,Manual Login,4,First step description using the [~username]  ,,First step expected result,"Manual Login Description

Bold

Italic

Underscript

 

Table:

One 	Two 	Three
1 	2 	3
4 	5 	6
  	  	 

 

 

google.com"
1,,Manual Login,4,"Second step description

Bold Italic Underline

With Table


one 	two
three 	four

",,Second step expeted result,
1,,Manual Login,4,Third step description using the [~Password]  ,,Third step expected result,
2,,Manual login (import from other test),3,First step description using the [~username]  ,,First step expected result,Manual login test with import of steps from another test
2,,Manual login (import from other test),3,"Second step description

Bold Italic Underline

With Table


one 	two
three 	four

",,Second step expeted result,
2,,Manual login (import from other test),3,Third step description using the [~Password]  ,,Third step expected result,
2,,Manual login (import from other test),3,Last step of manual login (after import step),,,


To import it into Xray, we use Test Case Importer with the recently created CSV file; you can use the configuration file provided with the .txt extension (XrayCSVImporter-configuration.txt).

Choose the Project into which you want to import the Tests, as shown below.


Once the issues are imported, we can see that it has created two issues with all the properties defined in the CSV.


More Details

Let's look into some specificities of this approach and some test particularities.

Manual Tests (With Steps) into Manual Test Case

qTest allows you to create Manual Test Cases with steps (using step description and expected results).

We have created two test cases using the steps separated into fields. 

After running the script that converts the Excel file into a CSV file we can see that each Test is created and the steps filled with the information extracted from the Excel file.

Manual Tests in comic_estore.csv
Issue ID,Issue Key,Test Summary,Test Priority,Action,Data,Result,Description
1,,Manual Login,4,First step description using the [~username]  ,,First step expected result,"Manual Login Description

Bold

Italic

Underscript

 

Table:

One 	Two 	Three
1 	2 	3
4 	5 	6
  	  	 

 

 

google.com"
1,,Manual Login,4,"Second step description

Bold Italic Underline

With Table


one 	two
three 	four

",,Second step expeted result,
1,,Manual Login,4,Third step description using the [~Password]  ,,Third step expected result,
2,,Manual login (import from other test),3,First step description using the [~username]  ,,First step expected result,Manual login test with import of steps from another test
2,,Manual login (import from other test),3,"Second step description

Bold Italic Underline

With Table


one 	two
three 	four

",,Second step expeted result,
2,,Manual login (import from other test),3,Third step description using the [~Password]  ,,Third step expected result,
2,,Manual login (import from other test),3,Last step of manual login (after import step),,,


The first Test corresponds to a Manual Test Case with the summary obtained from the CSV, and the description is the description extracted from the CSV. Notice that the content is available but the style format are not as they are not exported into the Excel file by qTest. 


In the first Test we also have several steps. Remember that the format are not exported to the Excel file and as so are not imported into Xray. The parameters must be recreated as they are not imported in Xray.

Modular test case from qTest are exported with the steps unfolded and with no reference to the original test case. 

Tests with data sets defined in qTest are imported without the data set.

All style formats are lost as they are not extracted by qTest into the Excel file.

The priority defined in qTest is also maintained when importing into Xray in all cases.

Other Tests

The script will convert all tests of type Manual; all the other types will be discarded, and no output will be created in the resulting CSV file.



Tips

  • Use the CSV file provided to import the examples and the associated txt configuration to have the setup and mapping correct.
  • Ensure you are using the scripts available for the right version of Jira (Cloud or Server).