Import Test Cases

Introduction

The Import Test Case feature helps you import test cases from Excel file (CSV/XLSX format) file into QMetry for Jira. 

Use Case: An organization has its test cases documented in an Excel file, now they have chosen QMetry for Jira app and want to import their test cases into QMetry.

Permissions Required

Jira Permissions :

  • Browse Project permissions are required.

QMetry Permissions :

  • If Enabled then the below permissions are required.

    • Import Permissions

    • All Test Case Permissions (except Delete)

    • Configuration Modify Permission - Users can create labels, components, new values for custom fields via import.

  • If not Enabled then any user with Jira browse project permission can import the Test cases to the project.

Where to Find the Feature

  1. Go to QMetry menu > Test Management > Test Case tab.

  2. Click on the Import button at top right.

Note: The Import button will be enabled only if the users have both Import and Test Case Create permissions. (In the case of QMetry Permissions are enabled.)

Steps to import test cases from a CSV/XLSX format

  1. Upload File

  2. Map Fields

  3. Import

Note: You can import a test case file with a maximum size of 10 MB.

Step 1. Upload File

  • Download Template.xlsx below for your reference. Ensure the file you are importing is as per the format as QMetry format. 

  • The Summary field is mandatory. 

  • For importing Test Case Steps, the Step Summary field is mandatory and should not be kept blank.

  • The key for the user is required to be mentioned in the Assignee and Reporter field columns in the Excel sheet, they are identified as below, to obtain the key of a particular user execute the Jira API below and note the key as highlighted below. In older versions of Jira, your key might look similar to your username but in the latest version of Jira, your key will be different than your username.

http://{BASE_URL}/rest/api/2/user/search?username={username}

  • Sprint should be specified as per the format Board Name/Sprint Name

 

If you want to import test cases/test steps with attachments, then follow the sub-steps 1. Upload Test Cases and 2. Upload Attachments both.

If you want to import only test cases/test steps, then follow the sub-step 1. Upload Test Cases. You can just skip the sub-step 2. Upload Attachments in this case.

 

(1) Upload Test Cases

You can either

  • Browse and select the Excel file to upload or

  • Drag the Excel file and drop it in the specific area on the screen

Notes:

  • Supported file types are XLS, XLSX and CSV.

  • The maximum file size allowed to upload is 10 MB.

 

(2) Upload Attachments

This step is optional and should only be followed if the test cases/test steps being imported have attachments and the attachment fields are mapped properly.

Attachments from separate folders can also be imported along with respective test cases/test steps while the import. The feature saves efforts and time of users as they do not have to add attachments to individual test cases/test steps.

Note: If the linkage of attachments fails due to any reason, the test case import will still happen and will be complete. In that case, either delete the imported test cases and import them again, or link the attachments manually to the imported test cases.

 

  • Download a sample zip file of attachments for your reference. After you unzip, skip the main folder from the path and mention the path thereafter in the template.

Notes:

  • Attachments in ZIP format are supported. You can include attachment of different formats like PNG, JPEG, DOC, PDF, XLSX and MP4 in the zipped file.

  • The maximum file size allowed to upload is 100 MB.

  • Multiple attachments can be imported for a single test case/test step at a time using a comma separator.

Browse and attach the zip file that contains attachments that you want to import along with test cases/test steps. The attachments will get imported in accordance with the attachment folder structure specified in the Excel file that has been uploaded in the Upload Test Cases step above. Refer to Attachment Fields for more details.

 

Once you upload the test case file and/or the attachment file, mention the details below.

  • Select Sheet: Once you upload the file, the drop-down starts showing the sheets included in the file. Select the one you want to upload.

  • Destination Folder: It displays the default path of the selected folder on the Test Case folder tree. This is the path wherein the test cases will be imported. You can change the import folder path by selecting another folder path on the drop-down list.

  • Date Format: This option is available only in case the import file is in CSV format. This option allows choosing the date format used for the Date type column from the CSV file.

  • If a Test Case with the same key already exists in the system, then:

    • Import with New Version: This will create a new version of your existing Test Case.

      • Note: The Import with New Version option will be enabled only if the users have the Test Case Versioning permission. (In the case of QMetry Permissions are enabled.)

    • Skip: The test case will be skipped.

  • If Test Case fields like components, labels do not exist in the project:

    • Create: New values for the list will be created in QMetry for Jira.

      • Note:

        • The Create option will be enabled only if the users have the Configuration Modify permission. (In the case of QMetry Permissions are enabled.)

        •  Fix Version, Sprint, Assignee, Reporter will not be created.

    • Ignore: New values in the Excel file will be imported as blank and existing values will be imported.

Click Next.

Step 2. Map Fields

  • There are two columns on the screen: QMetry Field and Sheet Field. Map the Sheet Fields with QMetry Fields. Enable Auto Mapping to auto map the fields.

  • The field values in Excel will be imported into QMetry for Jira accordingly. (Custom fields can be mapped)

  • QMetry Fields marked with * are mandatory to be mapped with Sheet Field.

  • If the system fields and custom fields are marked as mandatory under Project Configuration, then make sure these fields are not blank in the Excel sheet.

Folder

In addition to the Destination Folder Path selected in Step# 1, you can import test cases in the Folder Paths defined in the Excel file. This folder path is mentioned in a specific column in the Excel file. You can also mention multiple folder paths to import test cases to multiple folders at a time. It helps users import the test cases in multiple folders at a time so that they can avoid repeated imports of the same test cases. If the folder field is not mapped, then the test cases will be imported in the Destination Folder path selected in step #1. If the folder field is mapped, then the test cases will be created in the folders under the Destination Folder path selected in Step #1.If the folder doesn’t exist, then the folders will be auto-created as per the hierarchy set in the folder path set in the actual file.

  • Multiple comma-separated (,) folder paths can be mentioned in the column. For example, If you want to import test cases in folder A and folder B, here is how the folders should be mentioned in the import file: Folder A, Folder B.

  • Folder path containing a sub-folder can also be mentioned. For example, “Configuration/Device Configuration”.

  • If the Folder Path mentioned in the sheet exists under the selected Destination Folder, then the test cases will be imported under the existing folder(s). So make sure you select the Destination Folder in Step #1 accordingly.

  • If the Folder Path mentioned in the sheet does not exist under the Destination folder, then new folders will be created under the Destination Folder Path that you selected at Step# 1 above. So make sure you select the Destination Folder accordingly.

Story Linkages

QTM4J provides an ability to link test cases with relevant Jira stories (i.e. Jira issue type mapped as Story) while importing the test cases through an Excel sheet using the Import Test Case feature. The mentioned stories should be available in Jira.

A column Story Linkages is added to the import test case sheet. You can also find the column when you export existing test cases to Excel. You can re-import the Excel sheet with story keys filled in.

Define the Issue Key in this column, which should be mapped at Step# 2 of Map Fields while importing test cases. The defined key is then linked to the test case that is being imported.
To link multiple stories in a test case at a time, define comma-separated Issue Keys in the Story Linkages column.

The feature is helpful when users have bulk test cases to import and also have to link stories with these test cases.

Permissions: Users should have Requirement Edit permission to import test cases with Story Linkages.

Attachment Fields

  • Test Case Attachment Path: Path of the folder where the attachments are stored in the attached zip file. If the files in zip folder are at root folder level, then this field can be left blank.  

  • Test Case Attachment Name: Name of the attachment to be linked with the test case.

  • Test Step Attachment Path: Path of the folder where the attachments are stored in the attached zip file. If the files in zip folder are at root folder level, then this field can be left blank.  

  • Test Step Attachment Name: Name of the attachment to be linked with the test step.

The attachments could be located at the root folder level or sub-folder level in the zip file.

→ Scenario 1: When the attachment is located under the sub-folder of the zip.

(A) When the sub-folder name and the Attachment Name are specified in the Excel file, then that particular file under the mentioned folder will be attached to the test case/test step.

(B) When only sub-folder name is mentioned in the Excel file, then all the files under that folder will be attached to the test case/test step.

→ Scenario 2: When the attachment is located at the root folder of the zip.

(A) When the Attachment Path is not mentioned, then all the files at the root folder will be attached to the test case/test step.

(B) When only Attachment Name is mentioned, then that particular file will be attached to the test case/test step.

For the Folders QMetry field, select the Excel sheet column in the Sheet Field in which the folders are mentioned.

Import Test Cases with Parameterized Steps

QTM4J provides the ability to import test cases with parameterized steps while importing test cases through Excel. If the parameters already exist in the Configuration section of the project, they will be reused. If the parameters are not available in the Configuration section of the project, they will be created in the section.

Use Case: Testers need to import test cases some of which have parameterized steps within them in Excel. The team needs to import parameters along with test case and step data in one go so that they can avert spending time on adding those parameters individually.

Required Permissions:

  • Configuration Modify permissions

  • Test Case Edit permissions

Steps

  • The syntax of parameterized step to be used in the Excel file is [~Parameter_name]. For example, [~Username].

  • When Excel has test cases with existing parameters imported, then the parameters are reused in the steps and associated in the Parameters section in the Steps tab on the test case detail page.

  • When Excel has test cases with parameters that do not exist in the project in QTM4J is imported, then the parameters will be auto-created in the project, if the user has the necessary permissions to create the parameters. If the user does not have the required (Configuration Modify) permissions, the new parameters in the steps will be displayed as a normal text string and shall not be created.

Note: This feature is not applicable to shared test cases in the project.

 

Once you are done with mapping the fields, click on the Start Import button.

Step 3. Import

The bar on the screen shows the progress of the test case import.

Click Done when the import process is over.