Forum Discussion
2 Replies
- nmraoChampion Level 3
Thank you rupert_anderson for pointing the script.
QATest, it is little confusing when you say "multiple headers to test case level". Because, headers are applicable only to the test steps that uses http transport protocol.
Did you try the script pointed by Rupert earlier?
If you have different requirement, please elaborate the question.I am assuming that you have multiple test steps (soap / rest / http request ) and you want those headers to all steps of that test case?
Then you can add the script into Setup Script of the test case with minor modification of the earlier pointed script.
Here is the modified script, you can change the headers as needed.
https://github.com/nmrao/soapUIGroovyScripts/blob/master/groovy/AddHeadersToMultipleSteps.groovy
- rupert_andersonValued Contributor
Hi,
Do you mean for a given TestCase, you want to add a set of headers to each request TestStep within it automatically?
If so, I noticed nmrao wrote a nice script to automatically add headers at a TestStep level:
https://github.com/nmrao/soapUIGroovyScripts/blob/master/groovy/SetHttpHeaders.groovy
This could be adapted to iterate over all TestSteps in a TestCase - Rao do you already have a script like this?
You can also add request filters to automatically add headers when requests are despatched, but this is generally a more complex process. Can explain more about this if necessary.
Regards,
Rupert
Related Content
- 5 years ago
- 2 months ago
Recent Discussions
- 2 days ago