Testlink 01 Requirements HowTo
Testlink 01 Requirements HowTo
xls
If you want to create a lot of requirements in TestLink easily, the easiest way is to use tables.
TestLink is able to use XML to import /export requirements. This document explains how to create
and edit TestLink requirements using XML files. Excel is used as XML editor to edit requirements.
Works with
Summary
To declare requirements, the excel pattern named “01-Requirements.xls” must be used. This file
could be used to update existing tests or to create new tests.
• The “Requirement Path” section (Yellow columns headers) can be used to declare folders
trees in TestLink (folders are named “Requirement Specification Operations” in TestLink
GUI).
• The “Requirement Content” section (Blue columns headers) can be used to declare
requirements in TestLink (requirements are named “Requirement Operations” in TestLink
GUI).
• The “Custom Fields” section (dark pink columns header) is hidden by default. This section can
be used to declare several Custom Fields in TestLink, by adding new columns if needed.
• The “Relation between Requirements” section (orange columns header) is hidden by default.
This section can be used to declare relations between requirements.
• The “Attachments” section (light green columns header) is used to list the number of already
linked attachments.
• All “Requirement Content” provided after a “Requirement Path” section will be inserted in
the last declared “Requirement Path” folder.
• Consecutives lines in the “Requirement Path” section are considered as a “subfolders” (tree)
declaration.
• The “Requirement Path” must provide the path from the root directory each time a folder
path is declared in the file. “Folder Name” and “Folder ID” must be declared several times in
the same file if the same folder is used for several sub-folders (see “parent1” example in
figures above).
User System
Type in
Section Requirement Requirement
TestLink
Specification Specification
Number
to use 1 2 3
in Excel
Status in Not
Draft Review Rework Finish Implemented Valid Obsolete
TestLink Testable
Letter to
use in D R W F I V N O
Excel
- Req Type : Requirement Type. If not filled, automatically set to « Use Case » by testlink
during import. Has to be filled with one of the following value :
- Linked Requirement(s) Type and ID 1 : to define the relation type between current
requirement ans listed requirements
- Format : {Type}:Linked Requirement ID
- The following values has to be used for Type information :
Type in
Parent Of Blocks Related To Child Of Depends On
TestLink
Number to
1 2 3 4 5
use in Excel
- If multi-Relations are listed for the same requirement, must be separated by ';'
- Example : {3}:Req-SandBox-2
- Number of Attachments: Inform on how many attachments are known for the current
Req/Req Specs. The number is automatically updated during XML Import and during the
addition of a new attachment using “Ctrl + j” Hotkey.
Each cell that contains too many characters is displayed with a red background.
1
The section is optional, but information is mandatory if section is used
When all Requirements have been written in Excel, just click on ‘Requirement Generation’ button to
execute the Excel Macro. Of course, macro execution must be allowed for the ‘01-
ImportRequirementsIntoTestLink.xls’ file.
If there is a problem with the content, the popup should explain why the generation failed.
The log file is created in the same Excel file folder, with the Excel file name (with a .log suffix).
If everything is OK with the file content, a popup will appear with the following text displayed
The XML file is created in the same Excel file folder, with the Excel file name (the .xls suffix is replaced
by a .xml suffix).
XML file generated by the macro must be used during the import process.
1) Select the folder representing the root directory where all folders and requirements will be
inserted. This can be the root directory or a folder in the folder tree.
WARNING :
Test case content is depending of the text editor that you use when you write Test cases
(CKEditor, FCKEditor, …). The provided function should be used to import requirements ONLY
WHEN NO ADVANCED EDITOR IS USED :
Editor internal information (HTML tags) will be showed if an advanced editor has been used,
and Requirements content could be altered when importing back to TestLink.
If you want to import Requirements exported from TestLink, just click on ‘Import Requirements From
TestLink’ button to execute the Excel Macro. Of course, macro execution must be allowed for the
‘01-ImportRequirements.xls’ file.
A confirmation message is displayed; the user must acknowledge that all current data in the
spreedsheet will be lost.
The file generated by TestLink is parsed by the Excel macro. Depending of the content, this analyze
can be time-consuming. A GUI inform user about import progression.
When finished, the Excel content represents the content of each test case.
If you want to edit “advanced” information about requirements (custom fields, execution type,
External ID, Keywords), you have to display hidden columns.
You can now edit requirements information and import content back to TestLink to create a new
version or update the last version.
After an export, Requirement Specification ID and Requirement ID are correct in the Excel file, the
best configuration to Import back into TestLink is to use DOC ID as identifier. With this provided
configuration, you can modify the Requirement name if needed :
• Generate a Requirements XML file with Excel has been tested with Excel 2003, Excel
2007, 2010 and 2013 versions.
• Relations are imported at the end of the XML file to avoid the risk of “unknown
requirement” if a requirement is linked to an undefined (yet) requirement.
• In Relation between Requirements column, if more than one value is provided, each
value can be provided on its own row (Alt + Enter to add a Carriage Return in the
cell), separator between each value is semi-comma (;)
• If your requirements titles are longer than 100 characters, titles will be reduced by
TestLink during import. You have to modify const.inc.php to reconsider the value of
title field size (max is 255 caracters)
• If your XML requirement file is bigger than 400Kb, you have to edit
custom_cfg.inc.php to change “$tlCfg->import_file_max_size_bytes” parameter. To
set new limit file size to 1Mb, modify this parameter from ‘409600’ to ‘1024000’.
• During import into Testlink, don’t use “Import” function from “Requirement
Operation” section but use only “Import” function from “Requirement Specifications
Operation”. If not, a mysql error message will be displayed.
• The Requirement Specification Node Order is not saved by TestLink during import.
You cannot use Node Order in Excel to reorder your Requirements Specification into
TestLink. You have to drag and drop your folders in Web Page.
• During import from TestLink, if XML file presents more Custom Fields values that
Custom Fields Columns exists in excel, import is cancelled to let user add more
columns.
• In Custom Fields columns, if more than one value has to be provided (Multi Selection
List type), each value has to be separated by | character.
• Attachments are stored on the File System in the same folder than 01-
Requirements.xls file. All attachments are stored in “Req” and “ReqSpecs” folders,
depending of the linked item. Each “Req” and “ReqSpecs” with attachment has his
own folder to store attachments, using “Req-ID” or “Folder-ID” value as identifier.
• In import result log view, you can search for “ok”, “skipped”, “updated” or
“duplicate” keywords to verify that TestLink import comportment is coherent with
your needs.