1

In karate, I want to use the Response data(Scenario 1) to next or another request(Scenario 2) as Json.

I'm not able to pass it with def also. Can anyone help

Scenario 1: POST : User Given path '/authentication/v1/token/passwordless' And headers headers And request { username : '#(activeUsername)' } When method POST Then status 200 And print response

  • def passwordLessToken = response.tokenValue And print passwordLessToken

Scenario 2: POST With Session Detail : Valid Token from Passwordless Given path '/authentication/v1/token/ltpa' And headers withPasswordHeaders And request { tokenName : '#(tokenName)', tokenValue : +'passwordLessToken' } When method POST Then status 200 And print response

Mohamed M
  • 11
  • 2
  • Can u please confirm in which format have to pass the Value in Json? Scenario: User Given path '/authentication/v1/token/passwordless' And request { username : '#(activeUsername)' } And print activeUsername When method POST Then status 200 And print response And match response.tokenName == Respo[0].tokenName * def passwordLessToken = response.tokenValue And print passwordLessToken Given path '/authentication/v1/token/ltpa' And headers withPasswordHeaders And request { tokenName : '#(tokenName)', tokenValue : response.tokenValue } When method POST Then status 200 – Mohamed M Apr 26 '21 at 13:52
  • that's a very basic question, search for answers or open a new question please – Peter Thomas Apr 26 '21 at 14:38

0 Answers0