Skip to main content
Skip table of contents

向测试用例集导入测试用例

您可以直接向测试用例集导入测试用例,导入文件(.csv格式)中的测试用例用例和测试用例集都将导入到执行导入的测试用例集。

注意

  • CSV文件的编码格式必须是:UTF-8!UTF-8!UTF-8!(重要的事儿说三遍!)
  • Excel默认的中文编码格式是:ANSI,所以在将Excel文件转换为CSV格式时,请确认编码格式也要从ANSI转换为UTF-8

在尝试导入测试用例之前请仔细阅读以下注意事项:

  1. 标题或者关键字是开始导入的必填字段。
  2. 如果要导入日期类型的字段请使用正确的日期格式。
    • 标准的日期格式请参考:Java SimpleDateFormat
    • 示例:如果要导入的时间日期为:2030-01-01 12:00 AM,请将日期格式设置为:yyyy-MM-dd h:mm a
  3. 如果要导入步骤,那么步骤ID是必填字段。
  4. 如果提供问题关键字的话,项目中已存在的相同问题关键字的问题会被更新。
  5. 如果需要在导入测试用例的时候直接将测试用例关联到项目中已存在的需求中,请在“需求”列中指定需求ID。
    注意:如果指定的需求ID在项目中未找到,测试用例仍然会被创建,只是不会关联到需求问题中。
  6. 如果需要在导入测试用例的时候同时导入测试用例集关联信息,请在“测试用例集”列中指定测试用例集路径。
    注意:如果指定的测试用例集路径在项目中未找到,新的测试用例集将会从导入文件中创建。
  7. 当测试用例导入过程完成后,会出现一个选项来创建“CSV配置文件”,这个文件包含了刚刚完成的用例导入的配置信息(例如:日期格式,字段映射关系等)。下次再导入测试用例的时候,可以通过加载这个配置文件来使用上次的导入配置信息。

请按照以下步骤从CSV文件导入测试用例:

  1. 从测试用例集列表中点击“编辑”图标。
  2. 选择一个测试用例集,点击“导入”图标。
  3. 点击“选择文件“按钮,找到需要导入的测试用例CSV文件。
  4. 如果需要,配置“分隔符”信息。
  5. 如果有上次导入后创建的“CSV配置文件”,选择“使用已存在的导入配置文件”来自动加载配置信息。
  6. 点击“下一步”按钮。
  7. 在“Jira字段”中选择字段以完成映射关系。
    • 注意:如果用户完成了第五步,那么字段映射关系将会自动生成
  8. 点击“导入”按钮完成测试用例导入。

注意

如果下次还需使用相同或相似的配置来导入其它CSV文件,在导入完成页面,点击“保存配置”链接,这次导入的配置信息将会生成一个.txt文件并保存到计算机上。

<图例 - UG0042_Test_Suite_Panel_Import_Test_Case_CN>

以下是使用此测试用例导入文件测试用例导入文件模板.csv导入之后的结果:

<图例 - UG0043_Test_Suite_Panel_Import_Test_Case_CN>

Tips for importing CSV data into JIRA fields

Below are some helpful tips when importing data from your CSV file into specific JIRA system fields and user created custom fields:

Jira FieldImport Notes
 -

synapseRT import only supports Jira system field (e.g. Summary, Priority ...) and custom fields from Jira standard field types (e.g. Checkboxes, Date Picker ...)

Jira advanced field types (e.g. Development Summary, Global Rank ...) and any field types from third party apps are not supported.

SummaryThis is the only required field.
Issue KeyYou can set the issue key for an imported issue. If an issue with a given key already exists in JIRA, it will be updated instead.
Component(s)You can import issues with multiple components by entering each component in a separate column.
Affects Version(s)You can import issues with multiple 'Affects Versions' by entering each version in a separate column.
Fix Version(s)You can import issues with multiple 'Fix Versions' by entering each version in a separate column.
Due Date
  • Use the syntax that complies with the Java SimpleDateFormat
  • Example: set date format to yyyy-MM-dd h:mm a if you are going to import date time value as 2030-01-01 12:00 AM
LabelsYou can import issues with multiple labels by entering each component in a separate column.
Epic LinkProvide Epic issue key if you want to link issues to an existing Epic in Jira.

Custom field types:

  • Date Picker
  • Date Time Picker
  • Use the syntax that complies with the Java SimpleDateFormat
  • Example: set date format to yyyy-MM-dd h:mm a if you are going to import date time value as 2030-01-01 12:00 AM

Custom field types:

  • Checkboxes
  • Labels
  • Select List (multiple choices)
  • You can import issues with multiple values by entering each value in a separate column.
  • Values for 'Checkboxes' and 'Select List (multiple choices)' fields require to be pre-defined in your Jira server.
  • Values for 'Labels' field are not required to be pre-defined in your Jira server, values will be created by import process.

Example:

Summary, Checkbox, Checkbox, Checkbox, Label, Label
"First issue", value1, , , Label1,
"Second issue", value2, , , Label1, Label2
"Third issue", value1, value2, value3, Label1,

Custom field types:

  • Number Field
  • Text Field (multi-line)
  • Text Field (single line)
  • URL Field
  • Values for those fields are not required to be pre-defined in your Jira server.
  • Values will be created by import process.

Custom field type:

  • Select List (cascading)
  • The '->' separator allows you to import the hierarchy.
  • Values for this field require to be pre-defined in your Jira server.

Example:

Summary, Cascading Custom Field
Example Summary, Parent Value -> Child Value

Custom field type:

  • User Picker (single user)
  • It requires to specify Jira 'username' in csv file in order to make a successful import.
  • The user(username) specified in csv five must be defined in Jira server already.

Downloadable examples

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.