用户可以使用XML文件一次创建多个测试用例和部分.从XML导入数据需要两个步骤.
XML文件规则
将文件导入系统
创建XML文件时必须考虑以下点
XML格式应该是树形结构.它应该从章节,测试用例和子部分开始.
XML格式如下所示
<section> <name>Login Functionality<name> <description>All test case related to login functionality. Positive and negative test cases</description> <case> <id>C2</id> <title>Correct Username and Passwordcombination</title> <template>Test Case (Text)<template> <type>Other<type> <priority>Medium<priority> <estimate/> <references/> <custom> <preconds>Login page should display</preconds> <steps>1. Enter correct username 2.enter correct password</steps> <expected>Usershould able to login successfully.</expected> </custom> </case> </section>
< case> tag支持TestRail中测试用例的所有属性,例如标题,估计,优先级,文本字段,前置条件,步骤,预期结果等.
自定义字段分组在< custom>下标签.
下表列出了各种自定义字段类型的导入格式
Type | 样本值 | 描述 |
---|---|---|
复选框 | TRUE | " true"或"false"(不带引号) |
日期 | 01 -07-2010 | yyyy-mm-dd格式的有效XML日期字符串 |
下拉列表 | < id> 5</id> | < id>中的值的ID(在管理区域的自定义字段选项中配置)标签 |
整数 | 1022 | 一个简单的整数 |
里程碑 | < id> 2</id> | < id>中里程碑的ID tag |
多和减;选择 | <item> <id>1</id> </item> <item> <id>2</id> </item> | < item>的列表记录,每个记录都有自己的ID(所以,就像Dropdown值列表一样) |
步骤 | <step> <index>1</index> <content>Step 1</content> <expected>Result 1</expected> </step> <step> <index>2</index><content>Step 2</content> </step> | < step>的列表记录,每个记录都有自己的索引,内容和可选的预期结果 |
字符串/文本 | Foobar | 一个简单的字符串 |
URL(链接) | http//google.com/ | 一个简单的URL作为字符串 |
用户 | <id>3</id> | < id>中的用户ID ; tag |
转到"测试用例"选项卡.
单击右侧的"导入测试用例"图标,然后选择"从XML导入"选项.
以下屏幕截图显示了导入测试用例图标和XML选择
它打开从XML向导导入.浏览并上传XML文件.
用户可以添加新的测试用例以及更新现有的测试用例.
选择后,单击"导入"按钮.
以下屏幕截图显示如何导出XML文件