Testlink File Formats
Testlink File Formats
2004 - 2010 TestLink Community Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. The license is available in "GNU Free Documentation License" homepage.
Revision History #
0.1 0.2
Description
Initial document
Added XLS format for test cases. Code contributed by lightbulb Added XML format for results Notes about internal and external ID New tag supported for results on TL 1.8 Test Case XML added support for custom fields Test Case XML added support for link requirements Updated Format for version 1.9 Updated documentation layout, corrected license, merged information from User manual (docbook support,etc.)
0.3
Francisco Mancardi Francisco Mancardi Francisco Mancardi Francisco Mancardi Martin Havlat
-2-
1 Introduction
TestLink is web based Test Management tool. This manual describes a format of files for import and export data. See the User manual and Installation manual for more information about tool. The latest documentation is available on web http://www.teamst.org .Feel free to use our forum if you have questions that the manual doesn't answer.
Table of Contents
1 Introduction 2 Import and Export data 2.1 Export/Import Test Project 2.2 Import/Export Test suite 2.3 Just one Test Case 2.4 All Test Cases in test suite 2.5 Import/Export Keywords 2.6 Import/Export Software Requirements 2.7 Results import 2.8 Import Test Cases from Excel via XML 2.9 Platforms 2.10 Custom Fields 3 4 4 5 6 9 9 10 12 12 14 16
-3-
File format
XML XML
Import
X X
Export
X X
Notes
All test suites and test cases. You can choose if export also assigned keywords. Test suite details, All test cases and child test suites and test cases. You can choose if export assigned keywords. Two types of exports can be done: Just one test case All test cases in test suite. Custom Fields and Requirements assigned are exported. Keywords export is optional. Keywords import is NOT supported. All test projects keywords
Test case
XML
X X X X X
X X
XML XML
X X
X X
Table 1: Items that can be exported/imported Limitation: Attached files and custom fields1 are not imported/exported. Table format (CSV) is not directly supported in some cases. You should convert it into XML before import. See below for more. Definition for Internal and Documentation Identifiers
Every object has its internal ID , this ID is value of ID column in database table Test cases and requirements are special case because they have internal and document ID. Every time you see keyword ID in xml format it indicates INTERNAL ID.
<?xml version="1.0" encoding="UTF-8"?> <testsuite name=""> <details><![CDATA[]]></details> <testsuite name="Communications"> <details><![CDATA[<p>Communication Systems of all types</p>]]></details> <testsuite name="Hand-held devices"> <details><![CDATA[]]></details> <testcase name="10 G shock"> <summary><![CDATA[]]></summary> <steps><![CDATA[]]></steps> <expectedresults><! [CDATA[]]></expectedresults> </testcase> <testcase name="Gamma Ray Storm"> <summary><![CDATA[]]></summary> <steps><![CDATA[]]></steps> <expectedresults><![CDATA[]]></expectedresults> </testcase> </testsuite> <testsuite name="Subspace channels"> <details><![CDATA[<p>Only basic subspace features</p>]]></details> <testcase name="Black hole test"> <summary><![CDATA[]]></summary> <steps><![CDATA[]]></steps> <expectedresults><![CDATA[]]></expectedresults> </testcase> </testsuite> </testsuite> <testsuite name="Holodeck"> <details><![CDATA[]]></details> <testcase name="Light settings"> <summary><![CDATA[]]></summary> <steps><![CDATA[]]></steps> <expectedresults><![CDATA[]]></expectedresults> </testcase> </testsuite> <testsuite name="Propulsion Systems"> <details><![CDATA[]]></details> <testsuite name="Main engine"> <details><![CDATA[]]></details> <testcase name="Emergency stop"> <summary><![CDATA[]]></summary> <steps><![CDATA[]]></steps> <expectedresults><![CDATA[]]></expectedresults> </testcase> </testsuite> </testsuite> </testsuite>
-5-
<?xml version="1.0" encoding="UTF-8"?> <testsuite name="Hand-held devices"> <details><![CDATA[]]></details> <testcase name="10 G shock"> <summary><![CDATA[]]></summary> <steps><![CDATA[]]></steps> <expectedresults><![CDATA[]]></expectedresults> <keywords> <keyword name="Klyngon"> <notes><![CDATA[Klyngon keyword notes]]></notes> </keyword> </keywords> </testcase> <testcase name="Gamma Ray Storm"> <summary><![CDATA[]]></summary> <steps><![CDATA[]]></steps> <expectedresults><![CDATA[]]></expectedresults> <keywords> <keyword name="Klyngon"> <notes><![CDATA[Klyngon keyword notes]]></notes> </keyword> <keyword name="Moon rocks"> <notes><![CDATA[Moon rocks keyword notes]]></notes> </keyword> </keywords> </testcase> </testsuite>
-6-
-7-
</summary> <steps><![CDATA[ <p>Preset bias to 0</p> <p>Enable <strong>long range</strong> communications control</p> <p>Simulate black hole interference</p>]]> </steps> <expectedresults><![CDATA[ <table width="200" cellspacing="1" cellpadding="1" border="1"> <caption>Main Results</caption> <tbody> <tr><td>Spin value</td><td>9.9</td></tr> <tr><td>Opposite Angle</td><td>18 rad</td></tr> <tr><td> </td><td> </td></tr> </tbody> </table>]]> </expectedresults> <custom_fields> <custom_field> <name><![CDATA[CF_SKILLS_NEEDED]]></name> <value><![CDATA[QA Engineer]]></value> </custom_field> <custom_field> <name><![CDATA[CF_ESTIMATED_EXEC_TIME]]></name> <value><![CDATA[12]]></value> </custom_field> </custom_fields> </testcase> </testcases>
-8-
<title><![CDATA[James Bond]]></title> </requirement> </requirements> </testcase> <testcase internalid="12648" name="Jump start"> <node_order><![CDATA[0]]></node_order> <externalid><![CDATA[184]]></externalid> <summary><![CDATA[]]></summary> <steps><![CDATA[]]></steps> <expectedresults><![CDATA[]]></expectedresults> <requirements> <requirement> <req_spec_title><![CDATA[RSPEC-001]]></req_spec_title> <doc_id><![CDATA[ENG-0002]]></doc_id> <title><![CDATA[Main Deflector]]></title> </requirement> <requirement> <req_spec_title><![CDATA[RSPEC-001]]></req_spec_title> <doc_id><![CDATA[DOC-009]]></doc_id> <title><![CDATA[James Bond]]></title> </requirement> </requirements> </testcase> </testcases>
<?xml version="1.0" encoding="UTF-8"?> <testcases> <testcase name="10 G shock"> <summary><![CDATA[]]></summary> <steps><![CDATA[]]></steps> <expectedresults><![CDATA[]]></expectedresults> </testcase> <testcase name="Gamma Ray Storm"> <summary><![CDATA[]]></summary> <steps><![CDATA[]]></steps> <expectedresults><![CDATA[]]></expectedresults> </testcase> </testcases>
Test cases in XLS format Every row must have four columns: Column number
1 2 3
Contents
Test case name summary steps
-9-
Expected results
First row will be skipped, because is supposed it contains column descriptions. Example:
Name Engine fast start up Engine emergency stop Summary Start up on 5 second Engine stop due to panic button. Etc. Etc. Steps Too fast write steps 1. 2. 3. Unlock panic button Press panic button Press confirm Expected results Kind nothing Engine must stop right now Etc.
Etc.
Illustration 1: Keywords frame includes buttons for import and export Example of CSV Keyword;Notes:
Klyngon;Klyngon keyword notes Moon rocks;Moon rocks keyword notes Example of XML with keywords:
<?xml version="1.0" encoding="UTF-8"?> <keywords> <keyword name="Klyngon"> <notes> <![CDATA[Klyngon keyword notes]]> </notes> </keyword> <keyword name="Moon rocks"> <notes> <![CDATA[Moon rocks keyword notes]]> </notes> </keyword> </keywords>
- 10 -
CSV file includes Identifier of document, title, description. Example of CSV file:
ENG-0001,Terrestrial Propulsor, ENG-0002,Main Deflector,"<p>Main deflector bla, bla, bla.</p>"
- 11 -
... </sect3>
TestLink uses such element as data for just one requirement. This element is defined via constant DOCBOOK_REQUIREMENT (check the code). i.e. <sect3> is default but could be modified. Each requirement content is maintain the following way: title receive text in tag <title> req_doc_id parse title for the first two words and add counter. You can modify regular expression directly in code. Default is "[ a-zA-Z_]*[0-9]*". description parse following elements after title (<para>, <orderedlist>, <informaltable>, etc.). DocBook elements are modified to HTML tags. Unknown ones are ommited. Warning: the original code could be modified to fit your structure of DocBook. Check requirement.inc.php (function importReqDataFromDocBook($fileName)) and related constants. Warning: generated REQ_DOC_ID is danger for the case of update. Because it's generated from file content without relation to existing testlink data.
<testcase external_id="1256" > <!-- Using INTERNAL ID ---> <result>f</result> <notes>Using INTERNAL ID as link </notes> </testcase> </results>
You can import several / multiple execution results using a single XML file
Step 4. Then we will get dialog box asking "Where do you want to put the data?"
- 13 -
- 14 -
Step 5. Choose option one "XML list in existing worksheet" with first cell $A$1 Step 6. You will be able to see following columns : name, summary, steps & expected results
Step 7. Copy your data into this file accordingly & save the file in XML Data (*.xml) format Step 8. Check your XML file for correctness by opening with the help of internet explorer.
- 15 -
Importing XML file into TestLink Step 1. Login in to TestLink > Select your project in dropdown list. Step 2. Click on Specification > Create New Suite > Select Suite > Click on Import Test Cases
Step 3. Browse for the XML file, submit it and you are done with the Importing.
2.10 Platforms
Platforms can be both imported and exported. The feature is available from TL 1.9
- 16 -
Example of data:
<?xml version='1.0' encoding='UTF-8'?> <platforms> <platform> <name><![CDATA[MAC OS]]></name> <notes><![CDATA[]]></notes> </platform> <platform> <name><![CDATA[Solaris 10]]></name> <notes><![CDATA[New Solaris]]></notes> </platform> <platform> <name><![CDATA[Solaris 8]]></name> <notes><![CDATA[]]></notes> </platform> <platform> <name><![CDATA[Solaris 9]]></name> <notes><![CDATA[]]></notes> </platform> <platform> <name><![CDATA[Windows 2008]]></name> <notes><![CDATA[]]></notes> </platform> <platform> <name><![CDATA[Windows 7]]></name> <notes><![CDATA[New MS OS]]></notes> </platform> </platforms>
- 17 -
Illustration 2: Custom field management window with Import and Export actions Example of definition file:
<?xml version='1.0' encoding='ISO-8859-1'?> <custom_fields> <custom_field> <name><![CDATA[CF_STRING]]></name> <label><![CDATA[String CF]]></label> <type><![CDATA[0]]></type> <possible_values><![CDATA[]]></possible_values> <default_value><![CDATA[]]></default_value> <valid_regexp><![CDATA[]]></valid_regexp> <length_min><![CDATA[0]]></length_min> <length_max><![CDATA[0]]></length_max> <show_on_design><![CDATA[1]]></show_on_design> <enable_on_design><![CDATA[1]]></enable_on_design> <show_on_execution><![CDATA[1]]></show_on_execution> <enable_on_execution><![CDATA[0]]></enable_on_execution> <show_on_testplan_design><![CDATA[0]]></show_on_testplan_design> <enable_on_testplan_design><![CDATA[0]]></enable_on_testplan_design> <node_type_id><![CDATA[3]]></node_type_id> </custom_field> <custom_field> <name><![CDATA[CF_LIST]]></name> <label><![CDATA[List Type CF]]></label> <type><![CDATA[6]]></type> <possible_values><![CDATA[Deep Purple|Yes|Queen]]></possible_values> <default_value><![CDATA[]]></default_value> <valid_regexp><![CDATA[]]></valid_regexp> <length_min><![CDATA[0]]></length_min> <length_max><![CDATA[0]]></length_max> <show_on_design><![CDATA[1]]></show_on_design> <enable_on_design><![CDATA[1]]></enable_on_design> <show_on_execution><![CDATA[0]]></show_on_execution> <enable_on_execution><![CDATA[0]]></enable_on_execution> <show_on_testplan_design><![CDATA[0]]></show_on_testplan_design> <enable_on_testplan_design><![CDATA[0]]></enable_on_testplan_design> <node_type_id><![CDATA[3]]></node_type_id> </custom_field> </custom_fields>
- 18 -