【发布时间】:2022-01-02 15:56:03
【问题描述】:
我有一个测试套件
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
我想将Login 测试用例的${token} 变量添加到 Refresh token 测试用例的Authorization 值。但它失败了。
有人帮我吗?
【问题讨论】:
标签: robotframework