Introduction & contents
This document provides information on the types of test information that users can import from TestLink into TestRail, the process of exporting data from TestLink, and the necessary steps for preparing and importing that data into TestRail. It also outlines what data can and cannot be imported and provides workarounds for situations where data cannot be imported into TestRail.
Features & limitations
TestRail supports importing test cases with all the relevant fields, from header fields to template fields, including separated test steps and custom fields, via CSV. The table below enumerates the data supported when importing test cases via CSV and the limitations.
To import test cases with custom fields from TestLink to TestRail, it is necessary to create matching custom fields in TestRail prior to the import process.
Exporting test cases from TestLink
You can export test cases from TestLink by following the steps below:
- Click on the Test Specification link
- In the Test Specification screen, click on the Actions icons. This action will reveal a menu of various options that can be applied to the test suites within the project
- Click on the export icon to export all the test suites within the given project. This will generate an XML file similar to our sample Cosmic-EStore.testproject.xml file
Converting TestLink XML to TestRail CSV
To import test cases into TestRail, you'll require a CSV file that is compatible with TestRail. You can obtain such a file by following these steps:
- Download the testlink-migration scripts from GitHub
- To convert the XML file to a CSV file for the specified project, use the following command in your terminal:
python3 TestLink2TestRail.py -i <input file> -o <output file>
- The input file should be the XML file that you've exported from TestLink
- The output file will be the newly generated CSV file
- You can utilize this newly generated CSV file for the import process. The generated CSV file looks similar to the Cosmic-EStore.testproject.csv file.
Importing test cases to TestRail
The common fields to all templates can be mapped to TestRail fields as per the table below. For fields that may not exist by default in TestRail, you can create a new custom field to map your data to.
|TestLink Excel columns
|Steps (Expected Result)
|Steps (Additional Info)
Importing test case data into TestRail is very straightforward. Just navigate to the project you want to import the test cases and follow the steps below.
- Navigate to the Test Cases page
- Click the Import Cases icon on the top of the page and select Import from CSV
- On the first step of the import dialog:
- Select the CSV file you want to import
- Select the Section you want the file to be imported to
- Set the CSV delimiter to be a comma (or the delimiter you used when saving the file)
- Set the Start Row to 1
- Is header row checkbox should be checked as our Excel sheet includes a header row
- Set the Template to Test Case (Steps)
- Click Next
- On the second step of the import dialog:
- Set the Row Layout to Test cases use multiple rows
- Set the Column to detect new test cases value to Summary. This means new test cases will be detected based on the different summaries available
- Map the CSV columns to TestRail fields (you can see a simple example in the image below)
- Check the option Ignore test cases/records without a title
- Click Next
- On the third step of the import dialog:
- Select Remove HTML tags from CSV values for all fields and choose the corresponding values for Test Type and Test Priority
- Click Next
- On the fourth and last step of the import dialog:
- Confirm the information processed by TestRail is as expected
- Click Import
- Once the import is done, you will get the confirmation dialog, as shown in the screenshot below.
Viewing imported data in TestRail
You should now see your imported test cases as per the image below.