robot-framework-tutorial
  • Robot framework向导
  • 环境搭建
  • 简易案例
  • 语法介绍
  • 自定义类库
  • 接口测试案例
  • Web测试案例
  • App测试案例
  • 结束语
Powered by GitBook
On this page

接口测试案例

Previous自定义类库NextWeb测试案例

Last updated 6 years ago

这里以X包利率为例 测试用例xbao.robot

*** Settings ***
Library     RequestsLibrary

*** Test Cases ***
Get YuEBao Interest Rate
    Create Session    yuebao    https://yebprod.alipay.com
    ${resp}=    Get Request    yuebao    /yeb/iframe/qiriIframe.htm
    Should Be Equal As Strings    ${resp.status_code}    200
    ${ret}=    Convert To String    ${resp.content}
    Log    ${ret}
    ${interest_rate}=    Should Match Regexp    ${ret}    var\\s*Data=\\[(.*)\\]
    Log    ${interest_rate}

*** Keywords ***

运行结果

robot xbao.robot
xbao