Search code examples
soapuiweb-api-testing

What is the best way to centralize header for test suite of REST api in SOAP UI?


I want to achieve centralization for header. I made an test suite for one API but it has authorization key in it's header for user. If I want to test for another user, I have to change authorization header in all test cases. Is there any way to centralize header authorization in SOAP UI ?


Solution

  • You can define a variable on a Test Suite level, e.g. myHeader with value 123.

    Then set the required HTTP header to ${#TestSuite#myHeader}. During the test execution the ${#TestSuite#myHeader} is replaced with actual value of the variable, e.g. 123.

    For further study you can visit Working with Properties from SoapUI documentation.