httprunner 3.x 带参数接口测试(get方法)

接口信息如下:

 

 

 这边的null ,在python中是None的意思

 

 

 接口访问如下:

 

 测试用例(pytest格式):

 

 

 运行结果如下:

 

 测试用例(yml格式):

config:
    name: "hz测试"
    variables:
      uid: 1***7
      choujiang_id: 8*
      username: m*
    base_url: "https://lo****uyin.com"
    verify: False

teststeps:
-
    name: "接口test /lotteryTest.php"
    request:
        method: GET
        url: /lotte**st.php
        params:
          uid: $uid
          choujiang_id: $choujiang_id
          username: $username
    validate:
        - eq : ["status_code", 200]

运行结果如下:

 

posted @ 2020-07-24 23:05  yimu-yimu  阅读(998)  评论(0编辑  收藏  举报