Store AUTH TOKEN in Global Variable

Hi Julian_Wladyczynski

Please retry by following this step:

1. Assigned access_token value to the GlobalVariable

response = WS.sendRequest(findTestObject('Employees/Login backoffice and get access token'))
WS.verifyResponseStatusCode(response, 200)
JsonSlurper slurper = new JsonSlurper()
Map parsedJson = slurper.parseText(response.getResponseText())
String access_token = parsedJson.access_token
GlobalVariable.Token = access_token

2. On the GET request, set the Variable as below.

3. Using the access_token in the request header.

Hope this helps.

5 Likes