Token need to get from response and pass in other api | Rest Assured Forum
R
ruma Posted on 29/11/2019

Scenario:

1)I have user api which  has payload email,password

2)post request

3) it will generate token in response

4) This token how to get automatically from response

5) So can pass in next api

Note: need your assistance


R
ruma Replied on 29/11/2019

Its resolved

String response1=RestAssured.given().contentType(ContentType.JSON).log().all().when().body(obj).when().post().then().extract().path("token").toString();


S
Support Team Replied on 30/11/2019

Yes .. coreect...