Extract a token and Assign it to the global variable

24 Views Asked by At

In the below code snippet, I am extracting the Token but while using i observed the token's availability is for the current test not for other test. Is there a direct method to assign the token to any global variable so i can use this for other test cases.

    http().client(CommonClass.URL).send().post(endPoints.OTP_VERIFY).contentType("application/json").payload("{\"phone\":\"${MobileNumb}\",\"otp\":\"${otp}\"}");
    http().client(CommonClass.URL).receive().response(HttpStatus.CREATED).messageType(MessageType.JSON).extractFromPayload("$.payload.accessToken", "Token");

Regards Geeks

0

There are 0 best solutions below