UFT11.50-服务测试-如何从响应正文中获取数据 [英] UFT11.50 - Service Test - How can I obtain the data from the response body

查看:64
本文介绍了UFT11.50-服务测试-如何从响应正文中获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

{
    "Id": 456,
    "Type": null,
    "Name": "Store112",
    "Root": "\\\\server\\ShareFolder",
    "Username": "alm",
    "Password": null
}

这是来自HTTP请求的JSON文件响应正文,如何获取'ID'属性的值? UFT QTP 是否具有支持此功能的功能?

This is a JSON file response body from a HTTP Request, how can I get the value of 'ID' property? Does UFT or QTP has a function to support this?

推荐答案

为了在响应中使用特定的JSON属性,您应该执行以下操作.

In order to use a specific JSON property from the response you should do the following.

  1. 在属性窗格中选择 HTTP 标签
  2. 响应正文部分中,从下拉列表中选择JSON
  3. 加载预期的JSON响应样本
  1. Select the HTTP tab in the properties pane
  2. In the Response Body section select JSON from the drop down list
  3. Load a sample of the expected JSON response

然后在您要使用该值的活动中,单击输入参数的链接图标,选择 HTTP 选项卡,然后从 Output 中选择Id属性. >部分.

Then in the activity you want to use the value, click the link icon for the input parameter, select the HTTP tab and select the Id property from the Output section.

这篇关于UFT11.50-服务测试-如何从响应正文中获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆