安装robotframework、robotframework-requests

pip install robotframework
pip install robotframework-requests

编写脚本httpbin.robot

*** Settings ***
Documentation    Suite description
Library  RequestsLibrary


*** Test Cases ***
Test title
    &{headers}=  create dictionary  Content-Type=application/x-www-form-urlencoded
    log  ${headers}
    create session  httpbin  https://httpbin.org     headers=${headers}
    &{data}=  create dictionary  a=1  b=2  c=3
    ${resp}   post request  httpbin  /post  data=${data}
    log  ${resp.status_code}

命令行运行

robot httpbin.robot 

相关文章:

  • 2022-12-23
  • 2021-07-05
  • 2022-12-23
  • 2021-08-01
  • 2022-01-17
  • 2021-10-19
  • 2022-12-23
猜你喜欢
  • 2021-11-17
  • 2021-08-20
  • 2021-04-30
  • 2022-12-23
  • 2021-12-06
  • 2021-11-29
相关资源
相似解决方案