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, and 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.

Most of the test case information will be migrated seamlessly, but please check the following table for more details.

Supported FeaturesUnsupported
  • Test and Test steps
  • Preconditions
  • Test case attachments
  • Data sets
  • Test Cycles
  • Test Modules
  • Test Suite
  • Test Plans
  • 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.

Precondition

(Field in Test Case entity)

Precondition

(independent entity)

In qTest, the precondition is one field in the test case.

In Xray, a Precondition is a different entity and one Test Case can be linked to several Preconditions.

The precondition field from qTest is converted into a Precondition issue in Xray and linked back to the Test.




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
  • Only users that have the Make Bulk Changes permission will have this option available. Additionally, the user will only be able to import data into projects where he has the Create Issues permission.




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 Type,Test Summary,Test Priority,Action,Data,Result,Issue Type,Precondition,Precondition Type,Description,Unstructured Definition,Gherkin Definition
1,,,Precondition,,,,,precondition,,Manual,Precondition,,
2,,Manual,Manual Login,4,First step description using the @username  ,,First step expected result,Test,1,,"Manual Login Description

Bold

Italic

Underscript

 

Table:

One 	Two 	Three
1 	2 	3
4 	5 	6
  	  	 

 

 

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

Bold Italic Underline

With Table


one 	two
three 	four

",,Second step expeted result,Test,,,,,
2,,Manual,Manual Login,4,Third step description using the @Password  ,,Third step expected result,Test,,,,,
3,,,Automated test pre condition,,,,,precondition,,Generic,Automated test pre condition,,
4,,Generic,Automated test ,3,,,,Test,3,,Automated test description,Automated test description,
5,,Cucumber,Scenario test case,2,,,,Test,,,Scenario test case description,,"Given is on a Linux Computer using Chrome
And is a Primary Account Holder
And transfers money from a Checking to a Checking
And would like to send transfer Once
And sends it Today
And it is a Small
When transfer is submitted by customer
Then transfer should be properly initiated
"
6,,,Performance precondition step,,,,,precondition,,Manual,Performance precondition step,,
7,,Manual,Performance test,1,"Performance step 1 definition

",,Performance step 1 expected result,Test,6,,Performance test description,,
7,,Manual,Performance test,1,Performance step 2 definition,,Performance step 2 expected result,Test,,,,,
8,,Manual,Manual login (import from other test),3,First step description using the @username  ,,First step expected result,Test,,,Manual login test with import of steps from another test,,
8,,Manual,Manual login (import from other test),3,"Second step description

Bold Italic Underline

With Table


one 	two
three 	four

",,Second step expeted result,Test,,,,,
8,,Manual,Manual login (import from other test),3,Third step description using the @Password  ,,Third step expected result,Test,,,,,
8,,Manual,Manual login (import from other test),3,Last step of manual login (after import step),,,Test,,,,,



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 .json extension (importConfiguration.json).

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


When the import operation is complete, you can download the operation details, save the configuration for future use, or check the created issues.

When you click over the link to see the imported issues, we can see that it has created eight issues, three Preconditions and five Tests with all the properties defined in the CSV.


More Details

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

Precondition field into Precondition issue

In qTest Preconditions are defined in the step 0 of the Test that allows tables, different styles and multiline. 


When converting into a CSV for Xray, we are creating a new issue of type 'Precondition' where we convert the exported Excel of the precondition element.

As all the special formats are not exported into the Excel file they cannot be maintained. The content will be there but without the style.


The next line links the precondition to the Test.

qTest-Regression-TestCase.csv
Issue ID,Issue Key,Test Type,Test Summary,Test Priority,Action,Data,Result,Issue Type,Precondition,Precondition Type,Description,Unstructured Definition,Gherkin Definition
1,,,Manual Precondition
,,,,,precondition,,Manual,"Manual Precondition

Bold

Italic

Underscript

 

Table:

One 	Two 	Three
1 	2 	3
4 	5 	6
  	  	 

 

 

google.com <https://ccunha.qtestnet.com/p/122328/portal/google.com>",,
2,,Manual,Manual Login,4,First step description using the [~username]  ,,First step expected result,Test,1,,"Manual Login Description
...


Once imported into Xray we can see that the first line creates a Precondition in Xray.

The Precondition summary in Xray is extracted from the Step0 field of qTest, we extract a maximum of 254 characters or until the first newline (summaries in Jira do not allow newline).

The second line of the CSV file creates a Test and links the Precondition created in the same operation.


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, as explained above, the Preconditions issues are created and linked back to the Tests. 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 Type,Test Summary,Test Priority,Action,Data,Result,Issue Type,Precondition,Precondition Type,Description,Unstructured Definition,Gherkin Definition
1,,,Manual Precondition
,,,,,precondition,,Manual,"Manual Precondition

Bold

Italic

Underscript

 

Table:

One 	Two 	Three
1 	2 	3
4 	5 	6
  	  	 

 

 

google.com <https://ccunha.qtestnet.com/p/122328/portal/google.com>",,
2,,Manual,Manual Login,4,First step description using the [~username]  ,,First step expected result,Test,1,,"Manual Login Description

Bold

Italic

Underscript

 

Table:

One 	Two 	Three
1 	2 	3
4 	5 	6
  	  	 

 

 

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

Bold Italic Underline

With Table


one 	two
three 	four

",,Second step expeted result,Test,,,,,
2,,Manual,Manual Login,4,Third step description using the [~Password]  ,,Third step expected result,Test,,,,,
...


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.

Scenario Tests into Cucumber Test Case

qTest also allows the creation of Scenario test cases, this type define a scenario in the steps. For this tool to work make sure you have defined the scenario in one step.

After converting the Excel file using the available script we get the following output:

BDD Test in atm-exporter.csv
Issue ID,Issue Key,Test Type,Test Summary,Test Priority,Action,Data,Result,Issue Type,Precondition,Precondition Type,Description,Unstructured Definition,Gherkin Definition
...
5,,Cucumber,Scenario test case,2,,,,Test,,,Scenario test case description,,"Given is on a Linux Computer using Chrome
And is a Primary Account Holder
And transfers money from a Checking to a Checking
And would like to send transfer Once
And sends it Today
And it is a Small
When transfer is submitted by customer
Then transfer should be properly initiated
"
...


Importing into Xray will create a Cucumber Test with the description and the Scenario extracted from CSV file.


Performance Tests

Performance tests in qTest are defined with steps also, as we can see below. 

In order to import all the information from qTest the python script converts the content of the performance test into a manual test in Xray.

After converting the exported Excel file from qTest we obtain the following CSV output for the performance test.

qTest-Regression-TestCase.csv
Issue ID,Issue Key,Test Type,Test Summary,Test Priority,Action,Data,Result,Issue Type,Precondition,Precondition Type,Description,Unstructured Definition,Gherkin Definition
...
7,,Manual,Performance test,1,"Performance step 1 definition

",,Performance step 1 expected result,Test,6,,Performance test description,,
7,,Manual,Performance test,1,Performance step 2 definition,,Performance step 2 expected result,Test,,,,,
...


Importing the above file into Xray creates a manual test with the information present in the CSV.


Automated Tests

qTest test cases of type Automation have a summary, a description and the possibility to have steps, as we can see below.


In order to import the information from qTest and associate it to the correct type in Xray; the python script converts the content of the automation test into a Generic test in Xray.

After converting the exported Excel file from qTest we obtain the following CSV output for the performance test.

qTest-Regression-TestCase.csv
Issue ID,Issue Key,Test Type,Test Summary,Test Priority,Action,Data,Result,Issue Type,Precondition,Precondition Type,Description,Unstructured Definition,Gherkin Definition
...
4,,Generic,Automated test ,3,,,,Test,3,,Automated test description,,
...


Once imported into Xray we can see that the summary and the description are the ones defined in the CSV file and that the steps are discarded.


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



Tips

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