简体   繁体   中英

How can we perform 2 get request at same time Rest assured API Testing

JAVA RESTASSURED APITESTNG CUCUMBER

when I send get request using path variable and query param, I get a token in the response body and I will not get proper response until I add that token as a query param and send another get request.

So How can I perform that?

Given Cucumber Feature File

  • Given API has the following filed <"fieldName">
  • When API sends a "GET" request to "TranscationAPI"
  • Then API will receive the response code as 200
  • And the body will have following field

Should I change it to something like this?

  • Given API has the following filed <"fieldName">
  • When API sends a "GET" request to "TranscationAPI"
  • Then API will receive token as ""
  • When API sends again "GET" request to "TranscationAPI"
  • Then API will receive the response code as 200
  • And the body will have following field

Or I can use handle this through a different method.

背景是获取令牌的好地方 - 见https://cucumber.io/docs/gherkin/reference/#background

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM