Adding HTTP-headers to ALL test-cases of a test-suite (or several test-suites)?
We had to change the authentication mechanism for several web-applications that we developed. That means that for all our test-cases I now need to include a set of additional HTTP-headers to each and every call. Since our Test-suite covers a couple of hundreds of test cases adding these into each and every request seems like quite a monstrous task!
And there isn't even some copy-paste mechanism, i.e. I would have to clicke-di-click myself through the UI for a thousand times? NO way!
Is there a way to add common HTTP-headers (e.g. something like:
"Authorization: ${#Project#Access_Token}"
to ALL requests (or "Steps") of a test suite?
Ideally one wouldn't even have to add that to each individual request but there would be a common place to define those in single place and these headers would then be injected into all requests (visible maybe only in the RAW view).
Second-best solution would be to at least script the addition (and update/deletion) of those headers so one doesn't have to do that all in the GUI.
Are there any such helpers available?
- #1:
header value is a list. You can find my example in the below link where there is a separate method is defined to set the header including its value. you just need to call it as you needed.
http://stackoverflow.com/questions/37412281/script-assertion-to-get-token-and-set-it-as-http-header-to-the-next-test-step?noredirect=1#comment62336002_37412281
#2:
Yes, use context.expand('..') to have the actual value.
Good luck.