将 Web 服务响应另存为 XML

Save Web Service Response as XML

我正在使用 HP UFT nad HP ALM。我试图在 API-Test 中将 Web 服务响应保存为 xml。我找到了很多教程将响应保存在 Excel 中,但这不是我想要的。

这可能吗?如果没有,是否可以下载 .wsdl 响应?

API-测试构建

  1. 控制我的电脑上是否存在特定的xml文件(refernce.xml)
  2. 如果不存在则停止 test/if reference.xml 存在然后继续
  3. 现在我要保存回复
  4. 比较 2 个文件(reference.xml 和下载的 xml)

在 Api Tests/Components 中,您可以通过简单地使用可用的标准活动来做到这一点。

在“工具箱”菜单中,在 'Standard Activities' 下展开 'File' 列表并将 'Write to File' activity 添加到您的流程中。然后,在 activity 的 Input/Checkpoints 选项卡中,您可以设置导出路径(在路径中,您应该包括将生成的 name.xml 文件)和内容(对于您要生成的内容可以 select 响应的主要标签,它包含所有内容:例如)。

https://community.hpe.com/t5/Unified-Functional-Testing/UFT-API-Save-Response-as-xml/td-p/6867566

在 Api Tests/Components 中,您只需使用可用的标准活动即可完成此操作。

在工具箱菜单中,在 'Standard Activities' 下展开 'File' 列表并将 'Write to File' activity 添加到您的流程中。然后,在 activity 的 Input/Checkpoints 选项卡中,您可以设置导出路径(在路径中,您应该包括 name.xml file that will be generated) and the content (for the content you can select the main tag of the response, that holds all the content:` 例如)。

来源:https://community.hpe.com.