I have a test suite
Library RequestsLibrary
Library JSONLibrary
Library OperatingSystem
*** Variable ***
${base_url} https://api.sportpartnerxxx.vn/v1
${identity_URL} https://identity.sportpartnerxxx.vn
*** Test Cases ***
Login
${body}= Create Dictionary client_id=sportpartner-mobile-app client_secret=ifd-sportpartner-secret-2021-mobile-app grant_type=password username=abc password=123456
${header}= create dictionary content_type=application/x-www-form-urlencoded
${response}= Post ${identity_URL}/connect/token headers=${header} data=${body}
${token}= Set Variable Bearer ${response.json()["access_token"]}
Status Should Be 200
Refresh token
${body}= Create Dictionary client_id=sportpartner-mobile-app client_secret=ifd-sportpartner-secret-2021-mobile-app grant_type=password refresh_token=${refresh_token}
${header}= create dictionary content_type=application/x-www-form-urlencoded Authorization=&{token}
${response}= Post ${identity_URL}/connect/token headers=${header} data=${body}
Status Should Be 200
I want to take ${token} variable of Login test case add to Authorization value of Refresh token test case. But it failed.
Does anyone help me?