博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
更改TestStep的request header和获取TestStep的response header
阅读量:6977 次
发布时间:2019-06-27

本文共 656 字,大约阅读时间需要 2 分钟。

更改TestStep的request header

for example

def userId = "xxxxxxxxxxxxx"def request = context.testCase.getTestStepByName("xxx").testRequestdef existingHeaders = request.requestHeadersexistingHeaders["X-API-UserId"] = [(userId)]request.requestHeaders = existingHeaders

 

获取TestStep的response header

1. get the response header of  the current test step

def requestId = context.currentStep.testRequest.response.responseHeaders["RequestId"]

2. get the response header of which is not the current test step

def requestId = context.testCase.getTestStepByName("xxxx").testRequest.response.responseHeaders["RequestId"]

 

转载于:https://www.cnblogs.com/testing-life/p/6889722.html

你可能感兴趣的文章
一分钟了解 TCP/IP 模型
查看>>
json
查看>>
JavaScript实现冒泡排序
查看>>
在实践中我遇到stompjs, websocket和nginx的问题与总结
查看>>
Techshack Weekly 第 0002 期
查看>>
Ubuntu的apt-get使用国内的源
查看>>
Android系统--TouchEvent的处理流程
查看>>
基于Vue, Vuex 和 ElementUI 构建轻量单页Hexo主题Lite
查看>>
Bootstrap3.x - 源代码分析
查看>>
禁止蒙层底部页面跟随滚动
查看>>
PHP 单元测试
查看>>
用koa mongodb 做了个简单的博客系统
查看>>
教你用Vue渐进式搭建聊天室,从JavaScript=>TypeScript
查看>>
css3中的box-sizing属性
查看>>
2017-09-22 前端日报
查看>>
JavaScript深入理解对象方法——Object.entries()
查看>>
vue router 入门笔记
查看>>
一种无需留坑为页面动态添加View方案
查看>>
Vue的模板语法学习
查看>>
微信小程序server-1-搭建HTTPS server
查看>>