TestRail - Import TestCases XML


User can create multiple test cases and sections at a time using XML file. There are 2 steps processes require to import the data from XML.

  • Rules for XML file
  • Import the file into system

Rules for XML file

While creating XML file following point must be considered

  • XML format should be in tree structure. It should start with Sections, test cases and Sub-section.

  • The XML format would be look like as following

   <name>Login Functionality<name>
   <description>All test case related to login functionality. Positive and negative test cases</description>
      <title>Correct Username and Passwordcombination</title>
      <template>Test Case (Text)<template>
         <preconds>Login page should display</preconds>
         <steps>1. Enter correct username 2.enter correct password</steps>
         <expected>Usershould able to login successfully.</expected>
  • The <case> tag supports all properties of a test case in TestRail such as the title, estimate, priority, text fields, pre-conditions, steps, expected result etc

  • Custom fields are grouped under <custom> tag.

  • The following table lists the import formats for the various custom field types

Type Sample Value Description
Checkbox TRUE "true" or "false" (without the quotes)
Date 01-07-2010 A valid XML date string in yyyy-mm-dd format
Dropdown <id>5</id> The ID of the value (as configured in the custom field options in the administration area) in an <id> tag
Integer 1022 A simple integer number
Milestone <id>2</id> The ID of the milestone in an <id> tag
A list of <item> records, each with its own ID (so, like a list of Dropdown values)
   <content>Step 1</content>
   <expected>Result 1</expected>
    <index>2</index><content>Step 2</content> 
A list of <step> records, each with its own index, content and optionally expected result
String/Text Foobar A simple string
URL (Link) http//google.com/ A simple URL as string
User <id>3</id> The ID of the user in an <id> tag

Import CSV file

  • Go to Test Cases tab.

  • Click at import test cases icon at right side and select Import from XML option.

Following screenshot shows Import test cases icon and XML selection

Import CSV File
  • It opens Import from XML wizard. Browse and upload an XML file.

  • User can add new test cases as well as update existing test cases.

  • After selection, click on Import button.

Following screenshot shows how to export XML file

Export XML file