Tuesday, September 30, 2014

SoapUI Groovy Set Headers to Test Steps

During the development of my project we had to develop multiple REST endpoints.

A call to each of these REST endpoints needed to be authenticated by passing an oauth-token in their header.

Post development we had to change the core REST endpoints code to incorporate design changes.

In such situations it is necessary to do a quick regression test before pushing the code to QA.

In the following groovy snippet in soap ui we do the following:

1. Get the oauth token from the first test step
2. Parse the JSON reponse (refer to my previous post)
3. Iterate through each of the test steps and set the headers for each of them


No comments:

Post a Comment