更新
描述
object httptest.update(object/array webScenarios)
此方法允许更新存在的Web场景。
此方法只有Admin(管理员) 和 Super admin(超级管理员) 用户可用。可以在用户角色设置中撤销调用该方法的权限。更多信息请查看 User roles。
参数
(object/array)
需要被更新的Web场景属性。
每个Web场景必须定义httptestid
属性,其他的所有属性是可选的。只有通过的属性将被更新,其他的属性保持不变。
除了standard web scenario properties以外,此方法接受以下参数。
参数 | 类型 | 描述 |
---|---|---|
steps | array | 场景步骤用于替换现有步骤。 |
tags | array | Web场景标签。 |
返回值
(object)
返回一个包含被更新Web场景的ID的对象,ID在httptestid
属性下。
示例
启用一个Web场景
启动一个Web场景,即将其状态设置为“0”。
请求:
{
"jsonrpc": "2.0",
"method": "httptest.update",
"params": {
"httptestid": "5",
"status": 0
},
"auth": "700ca65537074ec963db7efabda78259",
"id": 1
}
响应:
{
"jsonrpc": "2.0",
"result": {
"httptestids": [
"5"
]
},
"id": 1
}
参见
来源
CHttpTest::update() in ui/include/classes/api/services/CHttpTest.php.