- 发行说明
- 入门指南
- 设置和配置
- 自动化项目
- 依赖项
- 工作流类型
- 文件比较
- 自动化最佳实践
- 源代码控件集成
- 调试
- 诊断工具
- 工作流分析器
- 变量
- 参数
- 导入的命名空间
- 基于触发器的 Attended 自动化
- 控制流程
- 对象存储库
- 日志记录
- ScreenScrapeJavaSupport 工具
- Studio 测试
- 扩展程序
- 故障排除
概述
Studio 中的应用程序测试以 VB 或 C# 执行。您可以为数据验证或与 CI/CD 管道集成等方案创建单个自动化项目。在 Studio 中设计工作流。您可以采用 VB 或 C# 来执行自动化应用程序测试。
条件
- Perform application testing through test cases and data-driven test cases.
- 如果测试自动化项目包含多个线性执行的测试用例,则测试自动化项目可能会有多个入口点,因为活动是按顺序组织的。
- 除非调用其他
XAML文件,否则按测试用例执行工作流。 - 您可以将工作流转换为测试用例,从其他项目导入工作流或创建新的工作流。
依赖项
创建测试用例
您可以通过从现有项目中调用工作流来创建测试用例。
-
在 Studio 中打开工作流。
-
在“项目”面板中,右键单击工作流,然后选择“创建测试用例”。
-
(Optional) Select Mock workflow under test when you create your test case if you want to make a copy of your workflow where you can mock specific activities. If you have an existing mock file that you want to use, you can select it from the Mock dropdown list. For more information, see Mock Testing.
-
(Optional) Select a Template from the dropdown list if you have created one previously. For more information, see Test Case Templates.
-
(Optional) Add the test case to an Execution Template. You need to have created an execution template first. For more information, see Create execution template.
-
Click Next if you want to add test data.
-
单击“创建”以确认更改。
系统将创建测试用例
XAML文件,调用具有以下容器的工作流:“Given”、“When”和“Then”。该文件是在“调用工作流文件”活动内部得到了调用,该活动为“When”容器的一部分。
工作流中的参数会自动导入。 要查看或添加更多参数,请单击“导入参数”按钮,该按钮是“调用工作流文件”活动的一部分。
发布测试用例
无论您是使用流程还是库,如果您的项目中有测试用例,那么您可以选择发布整个项目(“发布”)或仅测试用例(“发布测试用例”)。如果您正在处理测试自动化项目,您只能将测试用例发布到 Orchestrator。
要发布您在 Studio 中创建的测试用例,您必须将测试用例设置为可发布,因为默认情况下测试用例和数据驱动的测试用例都会创建为草稿。 要在所有类型的 Studio 项目中发布测试用例,请执行以下步骤:
-
右键单击工作流并选择“设为可发布”,以允许将测试用例发布到 Orchestrator。
The
xamlorcsicon will turn blue as an indication that the test case is ready to be published and packaged in anupkgfile. To revert back to your workflow draft, right-click the workflow and select Ignore from Publishing. -
发布项目:
- 如果是测试自动化项目,请在 Studio“设计”选项卡功能区中单击“发布”。
- 如果您正在“流程”或“库”项目中,请从 Studio 设计选项卡的功能区中单击“发布测试用例”。
-
针对发布操作配置“包”属性、发布选项和“证书签名”设置,然后单击“发布”以将您的测试用例发布到 Orchestrator。
You can publish the test cases to Orchestrator, to Robot defaults or a custom path. If you want to publish to Orchestrator, make sure your Robot or Assistant is connected to Orchestrator.
Publishing to Orchestrator is also required when you want to execute automated tests through Test Manager. Make sure to publish the package to the Orchestrator Tenant Process Feed, then link the test cases to Test Manager. Publishing the package in a different folder may result in execution errors.
将工作流转换为测试用例
要将工作流转换为测试用例,请在“项目”面板中右键单击该工作流,然后选择“转换为测试用例”:
Result: The workflow becomes a Test Case, and is regenerated based on the BDD Test Case template.
导入测试用例
如果您已经创建工作流或测试用例,则可以通过右键单击项目节点,然后选择“导入测试用例”,将其导入到当前项目中。导入的 XAML 文件会作为测试用例草稿添加到项目中。
导入服务
Similarly to importing data collections into API Test Automation libraries, you can import such collections into your Application Testing processes using the New Service wizard.
这仅适用于 Studio 配置文件中创建的库和“测试自动化”项目。