Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

How do I import test cases from CSV file with sections and subsections


I understand that I can only import a single suite of test cases in one import. However, I have been unable to figure out how to import a complex set of test cases (i.e. having multiple sections and subsections). I see examples of how to do this in the XML import but the subsection field is not in the mapping tool when you import a .csv file.

My export file has the following structure
ID, Section, Subsection, Title

Is it possible to do this and, if so, how do you define the mapping.



Hello Bruce,

Thanks for your posting. The CSV import can also import complex section hierarchies and supports this by using ‘>’ as part of the section field. For example, if you have the following values for the section column in your CSV file:

Section 1 Section 1 > Section 1.1 Section 2 Section 2 > Section 2.1 > Section 2.1.1

TestRail would automatically create the following hierarchy for this and add the test cases to the correct section:

]Section 1
]Section 1.1[/]
[]Section 2
[]Section 2.1
[]Section 2.1.1[/]

In order to implement this with your particular CSV layout, you would need to merge the Section and Subsection columns into a single Section column with the ‘>’ separator. So, if you have the following layout:

"Section","Subsection" Section 1, Section 1.1

You would need to change this to:

"Section","Subsection" Section 1 > Section 1.1, (can be left empty)

Would this work for you?



I exported a suite from TestRail, then tried to import back to a different project (just want to try). Nice to confirm myself that importing with section/subsection info is working :slight_smile:
Not sure if there is anything else, but one thing I noticed is that, the separate test steps and step test results are not imported back in in the correct format (ie. not using the expected steps format). Is this because of the export process (test steps and step results are exported to one row instead of multiple rows), or did I not configure the import as expected by TestRail?

How to import test steps and step results?


Vincent Nguyen.


Hi Vincent,

The CSV export format doesn’t currently list the separate steps in separate rows so the import feature wouldn’t be able to load this correctly. The workflow of exporting/importing CSV files is also not really useful as we have a much better/more structured XML format that would support this (e.g. to move test cases between TestRail instances). The CSV import/export feature is mainly designed for interoperability with other systems to e.g. migrate existing test cases to TestRail.


I am unable to see the .csv import option. What could be the problem?


Hi @hameetha,

The CSV import functionality is available on the case repository/suite pages:

Do you use a self-hosted installation of TestRail or TestRail Cloud? The CSV import was added with TestRail 4.1 last year and if you don’t see this feature then you would need to update your TestRail installation (ideally to the latest version). TestRail Cloud instances always use the latest version.

I hope this helps!



I am using the latest version ( and what you described worked. Also, I noticed that the exported CVS files already have the section Hierarchy that you specified already, except that it is within the Section Hierarchy, and not the Section column. So, I just copy to the Section column.

My question is since the system is smart enough to export the section hierarchy information, why can’t it put the information in the right column?



Hi Seth,

Thanks for your posting. The CSV export of TestRail is not necessarily intended for importing again and it’s mostly meant for interop with other tools or post-processing data easily with other tools (such as Excel). For exporting/importing from one TestRail instance to another, we recommend using the XML exports instead or to copy the database if you want an exact copy (e.g. for a staging system). To copy cases within the same TR instance, you can also simply use the Copy/Move Test Cases dialog instead. The CSV import is mostly meant for importing data from other systems but you can also use it to import data from another TR instance and you can then simply map Section Hierarchy to Section in this case.



Hi Tobias,
One more question about ability to import suite from csv. I am also can not manage to import suite with correct separate step. In my case all separated steps becomes as text list inside first separated step. An can not be divided for multiple separated steps.
In my case it is really necessary feature because our customer usually providing list of web-pages in excel format and I am not able to use for import XML because of huge effort for conversion from excel to XML.


Hi Sergey,

Thanks for your reply! I believe I’ve answered this in the other thread, but please let me know if you still need any assistance with this.



How do I import tests from .csv files into the existing Sections/sub-sections?

I already tried specifying hierarchy for example General>Users, but instead putting the test into existing section, a new section has been created, and it has the same labels as the exiting one, so basically after import my sections have been duplicated and I have to do a lot of manual work to assign tests properly.


The documentation is really awful and/or hasn’t been updated. All you need to do is make sure you export the Section Hierarchy and match that with “Section”. No need to even import or map the Section column.

Tips for importing test cases from CSV file

Hi apetrone,

Thank you for the post! It is currently only possible to import test cases from a CSV file under a single existing section or subsection at a time. To import test cases under an existing section or subsection, you would need to specify the appropriate section in the ‘Import To’ field on the on the first page of the import wizard (please see below) rather than importing the test cases with a column that contains the section hierarchy for column matching on page 2.


Without a value selected for the ‘Import To’ field in the import wizard, TestRail would automatically create new sections and subsections for the imported test cases using the values in the column selected for column matching. So you would just need to use the ‘Import To’ field to import test cases from a CSV file into an existing section in your test suite.

I hope this helps!