Forum Discussion
SmartBear_Suppo
13 years agoSmartBear Alumni (Retired)
Hi,
in a script step directly after the request step you would do
// get results of previous teststep
def result = testRunner.results[testRunner.results.size()-1]
// assert desired header
def headers = result.responseHeaders["<name of your response header>"]
assert headers != null && headers[0] != null && headers[0].indexOf( "<some substring>" ) != -1
regards,
/Ole
SmartBear Software
in a script step directly after the request step you would do
// get results of previous teststep
def result = testRunner.results[testRunner.results.size()-1]
// assert desired header
def headers = result.responseHeaders["<name of your response header>"]
assert headers != null && headers[0] != null && headers[0].indexOf( "<some substring>" ) != -1
regards,
/Ole
SmartBear Software
Related Content
- 10 years ago
- 4 years ago
- 12 years ago
Recent Discussions
- 4 days ago