更改TestStep的request header和获取TestStep的response header
更改TestStep的request header
for example
def userId = "xxxxxxxxxxxxx" def request = context.testCase.getTestStepByName("xxx").testRequest def existingHeaders = request.requestHeaders existingHeaders["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"]