Page History
Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Info | ||
---|---|---|
| ||
|
Note | ||||||
---|---|---|---|---|---|---|
| ||||||
|
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 Excel format, how to use a script (available in GitHub) to convert the excel 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 Features | Unsupported |
---|---|
|
|
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 synthesized summed up into the next table the existing mappings between qTest manager and Xray.
qTest | Xray | Comments |
---|---|---|
Test Case | Test | All three types of tests from qTest are imported into Xray. |
Info |
---|
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
Expand |
---|
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:
|
Examples
In each example, we will show how we obtained the excel Excel file from qTest, made the files available in GitHub, how to use the scripts to convert the excel 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 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
excelExcel from qTest and Import into Xray
In qTest when you choose to export using excel 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:
View file | ||||
---|---|---|---|---|
|
To import into Xray, we created one script to convert this excel Excel file into a CSV-compatible file to be imported into Xray.
The script will parse the excel Excel file and create a CSV file that can be imported into Xray. To execute the script, use the following command:
Code Block | ||
---|---|---|
| ||
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.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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 .jsontxt
extension (importConfigurationXrayCSVImporter-configuration.jsontxt).
Image RemovedImage Added
Choose the Project into which you want to import the Tests, as shown below.
Image Removed
When the import operation is complete, you can download the operation details, save the configuration for future use, or check the created issues.
Image Removed
Image Added
Once the issues are importedWhen you click over the link to see the imported issues, we can see that it has created eight issues, three Preconditions and five Tests two issues with all the properties defined in the CSV.
Image RemovedImage Added
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.
Image Removed
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.
Info |
---|
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.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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.
Image Removed
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.
Image Removed
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 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 each Test is created and the steps filled with the information extracted from the excel Excel file.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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 Login,4,,,,precondition,,ManualFirst step description using the [~username] ,,First step expected result,"Manual Login PreconditionDescription 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" 1,,Manual Login,4,"Second step description Bold Italic Underline With Table one two three four ",,Second step expeted result, 1,,Manual Login,4,FirstThird step description using the [~username~Password] ,,FirstThird 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 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,Test,,,,, 2,,Manual,Manual Login,4 login (import from other test),3,Third step description using the [~Password] ,,Third step expected result,Test,,, 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 Excel file by qTest.
Image RemovedImage Added
In the first Test we also have several steps. Remember that the format are not exported to the excel Excel file and as so are not imported into Xray. The parameters must be recreated as they are not imported in Xray.
Image RemovedImage Added
Info |
---|
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 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:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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.
Image Removed
Performance Tests
Performance tests in qTest are defined with steps also, as we can see below.
Image Removed
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.
Code Block | ||
---|---|---|
| ||
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.
Image Removed
Automated Tests
qTest test cases of type Automation have a summary, a description and the possibility to have steps, as we can see below.
Image Removed
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.
Code Block | ||
---|---|---|
| ||
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.
Image Removed
Info |
---|
The priority defined in qTest is also maintained when importing into Xray in all cases. |
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 JSON 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).
Table of Contents | ||
---|---|---|
|
CSS Stylesheet |
---|
.toc-btf { position: fixed; } |