UiPath Documentation
studio
2022.4
false
Studio 用户指南
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。

数据驱动的测试

概述

Data-driven testing lets you test RPA workflows and applications across various scenarios. To ensure your test cases use the prepared test data, debug and run data-driven test cases only from the Test Explorer panel. Visit Working With Test Explorer to read about the actions you can take within the Test Explorer panel.

数据源

为数据变体配置数据源时,可以从以下选项中进行选择:

管理测试数据

下表列出了您可以对包含数据变体的测试用例执行的操作。

操作 描述 程序

更新测试数据

通过选择创建新文件还是覆盖现有数据更新导入的测试数据。如果对 Excel 文件进行了任何更改,可以使用此操作。任何新列都将作为参数添加到测试用例中。

对于 Data Service 实体,您可以通过查询生成器使用新筛选器更新测试用例。

  1. 打开 Studio 并导航到您的项目。
  2. 在“项目”面板中,右键单击包含数据变体的测试用例,然后选择“更新测试数据”
  3. 从“来源”下拉列表中选择数据源。
  • For Files (e.g., Excel), you need to browse for the file and select the Worksheet. You can select individual or all values from the file.
  • For Data Service, you need to select an entity.
  • For Test Data Queue, you need to select a test data queue.

4.(可选)选择“使用相同的测试数据更新所有测试用例”以更新使用您当前正在编辑的测试数据的所有测试用例。

5. 单击“导入”以保存更改。

您可以在测试资源管理器中执行此操作,方法是右键单击文件,然后选择“更新测试数据”

删除测试数据

从测试用例中删除测试数据。

  1. 打开 Studio 并导航到您的项目。
  2. 在“项目”面板中,右键单击包含数据变体的测试用例,然后选择“删除测试数据”
You can perform this action in Test Explorer by right-clicking a file, and then choosing Remove Test Data.

修改测试数据 JSON 文件

直接将测试数据更新到 JSON 文件中。将测试数据添加到测试用例后,系统将创建文件。

Only for test data files.
  1. 打开 Studio 并导航到您的项目。
  2. 导航到“项目”>“测试数据”,然后使用代码编辑器打开 JSON 文件。

    JSON 文件名为 ExcelName_SheetNo.json

  • 概述
  • 数据源
  • 管理测试数据

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新