IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 开发测试 -> 【HttpRunner学习笔记】7- HttpRunner 关联参数&引用CSV文件 -> 正文阅读

[开发测试]【HttpRunner学习笔记】7- HttpRunner 关联参数&引用CSV文件

引言

我们在上一篇文章介绍如何在测试用例的响应数据的某个参数值,然后传递到依赖下一个测试步骤;

在实际项目中的测试用例难免会遇到传入多组数据,也可以看做一个业务场景就会有一组测试数据的应用,那么对于这种场景我们在应用HttpRunner构建脚本的时候,要如何去设计数据格式以及引用呢?

接下来本篇内容主要介绍了如何使用关联参数以及引用过CSV文件进行参数化;

1. 源码解析

使用httprunner改造过的pytest参数化,通过parameters这个字段去引用

import pytest
from httprunner import Parameters

pytest格式的脚本中ctrl+单击 Parameters方法,如下图:

在这里插入图片描述

跳转到httprunner的解析器文件parser.py

在这里插入图片描述

2. 关联参数

2.1 单个参数场景的参数化驱动

请求APIhttp://www.woshipm.com/api2/user/followings/status

对于这个接口需要传入一个authorIds,对应的值为单个作者ID,那么我们如果向这个参数同时传入多组数据呢?而一组数据即可执行一个测试场景;

2.1.1 yaml格式用法

config:
    name: testcase description
    parameters:
        author_id: ['801994', '1229873', '757351', '859990']
    ...
teststeps:
- name:
  request:
    ...
    method: GET
    params:
            authorIds: ${author_id}
    ...
  ...

由于我这里的请求方式为GET所以使用params作为关键字,如果是POST的话,可以将params修改为json

示例如下:
.env文件内容如下:

base_url=http://www.woshipm.com

完整代码:

config:
    name: testcase description
    parameters:
        author_id: ['801994', '1229873', '757351', '859990']
    variables: {}
    verify: false
    base_url: ${ENV(base_url)}
teststeps:
-   name: /api2/user/followings/status

    request:
        cookies:
            Hm_lpvt_b85cbcc76e92e3fd79be8f2fed0f504f: '1628342649'
            Hm_lvt_b85cbcc76e92e3fd79be8f2fed0f504f: 1628163442,1628172667,1628334320
            _DAU: done%21
            article_detail_normal: article_user_profile@article_items
            article_index: ''
            article_user_profile: article_recom_users@author_items
            dts_device_info: '%7B%22device_id%22%3A%22device_0ca45ac5-91b5-48f1-989f-09d72908c13f%22%2C%22device_brand%22%3A%22%22%2C%22device_model%22%3A%22%22%2C%22client_type%22%3A%22pc%22%2C%22os_type%22%3A%22Win32%22%2C%22os_version%22%3A%22%22%2C%22network_type%22%3A%22%22%2C%22browser_type%22%3A%22Chrome%22%2C%22browser_version%22%3A%2291.0.4472.124%22%7D'
            firstVisitTime: '1628342605147'
            isOverlayShowx: VVVV
            new_device_id: device_0ca45ac5-91b5-48f1-989f-09d72908c13f
            post_view_4751263: '2'
            s: NjM4ODgxLCwxNjI4MzQyNjAzOTM1LCxodHRwczovL3N0YXRpYy5xaWRpYW5sYS5jb20vd29zaGlwbV9kZWZfaGVhZF8xLmpwZywseWMsLDRkNDI0MzM0Y2U2NDQ2NDI5MThlNjFiZjNlZmQ5NjgzLTAtMQ%3D%3D
            t: MGJRTW5TU0xiU3M0TEY1QUg0N1NnTFhsWXVoYm5nOFlrbVM5MEpRbDEzaTI0TTk4NHFhTEZMSW1YZ0lnNEw0WU0wMXdhbVJFYTBmNnNrNDJpQUZRcG4xZXFwWHQwc3ZoL0Y2U0dhMHM0WTRrZ3RGU2dYMDM0WEU2OGU4b3FRTDA%3D
            wordpress_logged_in_41071e66c7856d347ba575b5339c5a86: 18144854885%7C1629552204%7CcnJRMC1LLCPnvL3ZEGLxFpuh3LXe1JeyovQ8OlsPvm6%7C3b42d3281e8bef80c1f7ef7c44ff0b7430bed59c80ff13f7e97cb93c3805feee
        headers:
            Accept: application/json, text/plain, */*
            Accept-Encoding: gzip, deflate
            Accept-Language: zh-CN,zh;q=0.9
            COMMON_ACCESS_TOKEN: MGJRTW5TU0xiU3M0TEY1QUg0N1NnTFhsWXVoYm5nOFlrbVM5MEpRbDEzaTI0TTk4NHFhTEZMSW1YZ0lnNEw0WU0wMXdhbVJFYTBmNnNrNDJpQUZRcG4xZXFwWHQwc3ZoL0Y2U0dhMHM0WTRrZ3RGU2dYMDM0WEU2OGU4b3FRTDA=
            COMMON_ACCESS_TOKEN_SECRET: NjM4ODgxLCwxNjI4MzQyNjAzOTM1LCxodHRwczovL3N0YXRpYy5xaWRpYW5sYS5jb20vd29zaGlwbV9kZWZfaGVhZF8xLmpwZywseWMsLDRkNDI0MzM0Y2U2NDQ2NDI5MThlNjFiZjNlZmQ5NjgzLTAtMQ==
            Connection: keep-alive
            Cookie: new_device_id=device_0ca45ac5-91b5-48f1-989f-09d72908c13f; isOverlayShowx=VVVV;
                Hm_lvt_b85cbcc76e92e3fd79be8f2fed0f504f=1628163442,1628172667,1628334320;
                dts_device_info=%7B%22device_id%22%3A%22device_0ca45ac5-91b5-48f1-989f-09d72908c13f%22%2C%22device_brand%22%3A%22%22%2C%22device_model%22%3A%22%22%2C%22client_type%22%3A%22pc%22%2C%22os_type%22%3A%22Win32%22%2C%22os_version%22%3A%22%22%2C%22network_type%22%3A%22%22%2C%22browser_type%22%3A%22Chrome%22%2C%22browser_version%22%3A%2291.0.4472.124%22%7D;
                article_index=; article_user_profile=article_recom_users@author_items;
                article_detail_normal=article_user_profile@article_items; _DAU=done%21;
                wordpress_logged_in_41071e66c7856d347ba575b5339c5a86=18144854885%7C1629552204%7CcnJRMC1LLCPnvL3ZEGLxFpuh3LXe1JeyovQ8OlsPvm6%7C3b42d3281e8bef80c1f7ef7c44ff0b7430bed59c80ff13f7e97cb93c3805feee;
                t=MGJRTW5TU0xiU3M0TEY1QUg0N1NnTFhsWXVoYm5nOFlrbVM5MEpRbDEzaTI0TTk4NHFhTEZMSW1YZ0lnNEw0WU0wMXdhbVJFYTBmNnNrNDJpQUZRcG4xZXFwWHQwc3ZoL0Y2U0dhMHM0WTRrZ3RGU2dYMDM0WEU2OGU4b3FRTDA%3D;
                s=NjM4ODgxLCwxNjI4MzQyNjAzOTM1LCxodHRwczovL3N0YXRpYy5xaWRpYW5sYS5jb20vd29zaGlwbV9kZWZfaGVhZF8xLmpwZywseWMsLDRkNDI0MzM0Y2U2NDQ2NDI5MThlNjFiZjNlZmQ5NjgzLTAtMQ%3D%3D;
                firstVisitTime=1628342605147; post_view_4751263=2; Hm_lpvt_b85cbcc76e92e3fd79be8f2fed0f504f=1628342649
            Host: www.woshipm.com
            Referer: http://www.woshipm.com/u/801994
            User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
                (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
            X-WP-Nonce: 452000896a
        method: GET
        params:
            authorIds: ${author_id}
        url: /api2/user/followings/status
    extract:
        - request_id: body.REQUEST_ID
    validate:
    -   eq:
        - status_code
        - 200
    -   eq:
        - headers.Content-Type
        - application/json;charset=UTF-8
    -   eq:
        - body.CODE
        - 200
    -   eq:
        - body.MESSAGE
        - 请求成功
    -   eq:
        - body.REQUEST_ID
        - ${request_id}
    -   eq:
        - body.HOST_ID
        - localhost

2.1.2 pytest格式用法

在使用参数化之前,必须要导入pytest库,和httprunner库的Parameters类;

使用httprunner改造过的pytest参数化,通过parameters这个字段去引用

import pytest
from httprunner import Parameters
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

class TestCaseWoshipmGetAuthor(HttpRunner):
    @pytest.mark.parametrize(
        "param", Parameters({"author_id": ["801994", "1229873", "757351", "859990"]})
    )
    def test_start(self, param):
        super().test_start(param)
    
    config = Config("testcase description").base_url("${ENV(base_url)}").verify(False)
    
    teststeps = [
        Step(
            RunRequest("/api2/user/followings/status")
            .get("/api2/user/followings/status")
            .with_params(**{"authorIds": "${author_id}"})
            ...

示例如下:

# NOTE: Generated By HttpRunner v3.1.6
# FROM: har\woshipm_get_author.yml


import pytest
from httprunner import Parameters
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

class TestCaseWoshipmGetAuthor(HttpRunner):
    @pytest.mark.parametrize(
        "param", Parameters({"author_id": ["801994", "1229873", "757351", "859990"]})
    )
    def test_start(self, param):
        super().test_start(param)

    config = Config("testcase description").base_url("${ENV(base_url)}").verify(False)

    teststeps = [
        Step(
            RunRequest("/api2/user/followings/status")
            .get("/api2/user/followings/status")
            .with_params(**{"authorIds": "${author_id}"})
            .with_headers(
                **{
                    "Accept": "application/json, text/plain, */*",
                    "Accept-Encoding": "gzip, deflate",
                    "Accept-Language": "zh-CN,zh;q=0.9",
                    "COMMON_ACCESS_TOKEN": "MGJRTW5TU0xiU3M0TEY1QUg0N1NnTFhsWXVoYm5nOFlrbVM5MEpRbDEzaTI0TTk4NHFhTEZMSW1YZ0lnNEw0WU0wMXdhbVJFYTBmNnNrNDJpQUZRcG4xZXFwWHQwc3ZoL0Y2U0dhMHM0WTRrZ3RGU2dYMDM0WEU2OGU4b3FRTDA=",
                    "COMMON_ACCESS_TOKEN_SECRET": "NjM4ODgxLCwxNjI4MzQyNjAzOTM1LCxodHRwczovL3N0YXRpYy5xaWRpYW5sYS5jb20vd29zaGlwbV9kZWZfaGVhZF8xLmpwZywseWMsLDRkNDI0MzM0Y2U2NDQ2NDI5MThlNjFiZjNlZmQ5NjgzLTAtMQ==",
                    "Connection": "keep-alive",
                    "Cookie": "new_device_id=device_0ca45ac5-91b5-48f1-989f-09d72908c13f; isOverlayShowx=VVVV; Hm_lvt_b85cbcc76e92e3fd79be8f2fed0f504f=1628163442,1628172667,1628334320; dts_device_info=%7B%22device_id%22%3A%22device_0ca45ac5-91b5-48f1-989f-09d72908c13f%22%2C%22device_brand%22%3A%22%22%2C%22device_model%22%3A%22%22%2C%22client_type%22%3A%22pc%22%2C%22os_type%22%3A%22Win32%22%2C%22os_version%22%3A%22%22%2C%22network_type%22%3A%22%22%2C%22browser_type%22%3A%22Chrome%22%2C%22browser_version%22%3A%2291.0.4472.124%22%7D; article_index=; article_user_profile=article_recom_users@author_items; article_detail_normal=article_user_profile@article_items; _DAU=done%21; wordpress_logged_in_41071e66c7856d347ba575b5339c5a86=18144854885%7C1629552204%7CcnJRMC1LLCPnvL3ZEGLxFpuh3LXe1JeyovQ8OlsPvm6%7C3b42d3281e8bef80c1f7ef7c44ff0b7430bed59c80ff13f7e97cb93c3805feee; t=MGJRTW5TU0xiU3M0TEY1QUg0N1NnTFhsWXVoYm5nOFlrbVM5MEpRbDEzaTI0TTk4NHFhTEZMSW1YZ0lnNEw0WU0wMXdhbVJFYTBmNnNrNDJpQUZRcG4xZXFwWHQwc3ZoL0Y2U0dhMHM0WTRrZ3RGU2dYMDM0WEU2OGU4b3FRTDA%3D; s=NjM4ODgxLCwxNjI4MzQyNjAzOTM1LCxodHRwczovL3N0YXRpYy5xaWRpYW5sYS5jb20vd29zaGlwbV9kZWZfaGVhZF8xLmpwZywseWMsLDRkNDI0MzM0Y2U2NDQ2NDI5MThlNjFiZjNlZmQ5NjgzLTAtMQ%3D%3D; firstVisitTime=1628342605147; post_view_4751263=2; Hm_lpvt_b85cbcc76e92e3fd79be8f2fed0f504f=1628342649",
                    "Host": "www.woshipm.com",
                    "Referer": "http://www.woshipm.com/u/801994",
                    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
                    "X-WP-Nonce": "452000896a",
                }
            )
            .with_cookies(
                **{
                    "Hm_lpvt_b85cbcc76e92e3fd79be8f2fed0f504f": "1628342649",
                    "Hm_lvt_b85cbcc76e92e3fd79be8f2fed0f504f": "1628163442,1628172667,1628334320",
                    "_DAU": "done%21",
                    "article_detail_normal": "article_user_profile@article_items",
                    "article_index": "",
                    "article_user_profile": "article_recom_users@author_items",
                    "dts_device_info": "%7B%22device_id%22%3A%22device_0ca45ac5-91b5-48f1-989f-09d72908c13f%22%2C%22device_brand%22%3A%22%22%2C%22device_model%22%3A%22%22%2C%22client_type%22%3A%22pc%22%2C%22os_type%22%3A%22Win32%22%2C%22os_version%22%3A%22%22%2C%22network_type%22%3A%22%22%2C%22browser_type%22%3A%22Chrome%22%2C%22browser_version%22%3A%2291.0.4472.124%22%7D",
                    "firstVisitTime": "1628342605147",
                    "isOverlayShowx": "VVVV",
                    "new_device_id": "device_0ca45ac5-91b5-48f1-989f-09d72908c13f",
                    "post_view_4751263": "2",
                    "s": "NjM4ODgxLCwxNjI4MzQyNjAzOTM1LCxodHRwczovL3N0YXRpYy5xaWRpYW5sYS5jb20vd29zaGlwbV9kZWZfaGVhZF8xLmpwZywseWMsLDRkNDI0MzM0Y2U2NDQ2NDI5MThlNjFiZjNlZmQ5NjgzLTAtMQ%3D%3D",
                    "t": "MGJRTW5TU0xiU3M0TEY1QUg0N1NnTFhsWXVoYm5nOFlrbVM5MEpRbDEzaTI0TTk4NHFhTEZMSW1YZ0lnNEw0WU0wMXdhbVJFYTBmNnNrNDJpQUZRcG4xZXFwWHQwc3ZoL0Y2U0dhMHM0WTRrZ3RGU2dYMDM0WEU2OGU4b3FRTDA%3D",
                    "wordpress_logged_in_41071e66c7856d347ba575b5339c5a86": "18144854885%7C1629552204%7CcnJRMC1LLCPnvL3ZEGLxFpuh3LXe1JeyovQ8OlsPvm6%7C3b42d3281e8bef80c1f7ef7c44ff0b7430bed59c80ff13f7e97cb93c3805feee",
                }
            )
            .extract()
            .with_jmespath("body.REQUEST_ID", "request_id")
            .validate()
            .assert_equal("status_code", 200)
            .assert_equal('headers."Content-Type"', "application/json;charset=UTF-8")
            .assert_equal("body.CODE", 200)
            .assert_equal("body.MESSAGE", "请求成功")
            .assert_equal("body.REQUEST_ID", "${request_id}")
            .assert_equal("body.HOST_ID", "localhost")
        ),
    ]


if __name__ == "__main__":
    TestCaseWoshipmGetAuthor().test_start()

2.2 多个参数场景的参数化

2.2.1 yaml格式用法

config:
    name: testcase description
    parameters:
        base_url: ${ENV(base_url)}
        user-password:
            - ["user01", "pasw01"]
            - ["user02", "pasw02"]
            - ["user03", "pasw03"]
    ...
teststeps:
- name:
  request:
    ...
    method: POST
    json:
         username: ${user}
         passworld: ${password}
    ...
  ...

2.2.2 pytest格式用法


import pytest
from httprunner import Parameters
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

class TestCaseLoginParams2(HttpRunner):
    @pytest.mark.parametrize(
        "param",
        Parameters(
            {
                "user-password": [
                    ["user01", "pasw01"],
                    ["user02", "pasw02"],
                    ["user03", "pasw03"],
                ]
            }
        ),
    )
    def test_start(self, param):
        super().test_start(param)

    config = Config("login case").base_url("${ENV(base_url)}")

    teststeps = [
        Step(
            RunRequest("step login")
            .post("/api/v1/login")
            .with_json({"username": "$user", "password": "$password"})
            .validate()
            .assert_equal("status_code", 200)
            ...
        ),
    ]


if __name__ == "__main__":
    TestCaseLoginParams2().test_start()

2.2.3 笛卡尔积组合用法

如下示例笛卡尔积组合的话,就有4*4=16中组合;

yaml格式:
config:
    name: login case
    base_url: ${ENV(base_url)}
    parameters:
        user: ["user01", "user02", "user03", "user04"]
        password: ["123456", "123456", "123456", "123456"]

teststeps:
-
    name: step login
    variables:
            password: 123456
    request:
        url: /api/v1/login
        method: POST
        json:
            username: ${user}
            password: ${password}
    validate:
        ...
pytest格式:
import pytest
from httprunner import Parameters
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

class TestCaseLoginParams3(HttpRunner):
    @pytest.mark.parametrize(
        "param",
        Parameters(
            {
                "user": ["user01", "user02", "user03", "user04"],
                "password": ["123456", "123456", "123456", "123456"],
            }
        ),
    )
    def test_start(self, param):
        super().test_start(param)

    config = Config("login case").base_url("${ENV(base_url)}")

    teststeps = [
        Step(
            RunRequest("step login")
            .with_variables(**{"password": 123456})
            .post("/api/v1/login")
            .with_json({"username": "${user}", "password": "${password}"})
            .validate()
            .assert_equal("status_code", 200)
            ...
        ),
    ]


if __name__ == "__main__":
    TestCaseLoginParams3().test_start()

3. 引用CSV文件进行参数关联

为了要使用csv文件进行参数化呢?

对于已有参数的列表,在我们实际业务当中,可能要使用数据量比较大的情况,在httprunner框架比较适合的方式就是将参数列表值存储在csv文件中;

而对于csv数据文件,需要注意的几项:

  • csv文件中的首行必须为参数名称,则从第二行开始为参数值,每个/组占一行;
  • 若同一个csv文件中存在多个参数,则参数名称和参数值使用英文逗号作为间隔符;
  • yaml/json文件引用csv文件时,文件路径为基于项目根目录,即为debugtalk.py文件所在同级路径的相对路径;

首先在项目har目录同级新建一个目录data,并新建user_password.csv文件,内容如下:

user,password
user01,123456
user02,123456
user03,123456
user04,123456

3.1 yanl 格式用法

然后在YAML/JSON 测试用例文件中,就可以通过内置的 parameterize(可简写为 P)函数引用 CSV 文件;

P函数的参数(CSV 文件路径)是相对于项目根目录的相对路径。
当然,这里也可以使用 CSV文件在系统中的绝对路径,不过这样的话在项目路径变动时就会出现问题,因此推荐使用相对路径的形式;

然后使用相对路径引用data/user_password.csv

config:
    name: login case
    base_url: ${ENV(base_url)}
    parameters:
        user-password: ${P(data/user_password.csv)}

teststeps:
-
    name: step login
    request:
        url: /api/v1/login
        method: POST
        json:
            username: ${user}
            password: ${password}
    validate:
        - eq: [status_code, 200]
        ...

3.2 pytest 格式用法

注意要重写父类的方法test_start,将的参数化变量传进去;

def test_start(self, param):
        super().test_start(param)
import pytest
from httprunner import Parameters
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

class TestCaseParamsCsv2(HttpRunner):
    @pytest.mark.parametrize(
        "param", Parameters(
            {
                "user-password": "${P(data/user_password.csv)}"
            }
        )
    )
    def test_start(self, param):
        super().test_start(param)

    config = Config("login case").base_url("${ENV(base_url)}")

    teststeps = [
        Step(
            RunRequest("step login")
            .post("/api/v1/login")
            .with_json({"username": "${user}", "password": "${password}"})
            .validate()
            .assert_equal("status_code", 200)
            ...
        ),
    ]

if __name__ == "__main__":
    TestCaseParamsCsv2().test_start()

3.3 示例

csv文件内容如下:

在这里插入图片描述

测试用例如下:

config:
    name: testcase description
    parameters:
        author_id: ${P(data/author_id.csv)}
    variables: {}
    verify: false
    base_url: ${ENV(base_url)}
teststeps:
-   name: /api2/user/followings/status

    request:
        cookies:
            Hm_lpvt_b85cbcc76e92e3fd79be8f2fed0f504f: '1628342649'
            Hm_lvt_b85cbcc76e92e3fd79be8f2fed0f504f: 1628163442,1628172667,1628334320
            _DAU: done%21
            article_detail_normal: article_user_profile@article_items
            article_index: ''
            article_user_profile: article_recom_users@author_items
            dts_device_info: '%7B%22device_id%22%3A%22device_0ca45ac5-91b5-48f1-989f-09d72908c13f%22%2C%22device_brand%22%3A%22%22%2C%22device_model%22%3A%22%22%2C%22client_type%22%3A%22pc%22%2C%22os_type%22%3A%22Win32%22%2C%22os_version%22%3A%22%22%2C%22network_type%22%3A%22%22%2C%22browser_type%22%3A%22Chrome%22%2C%22browser_version%22%3A%2291.0.4472.124%22%7D'
            firstVisitTime: '1628342605147'
            isOverlayShowx: VVVV
            new_device_id: device_0ca45ac5-91b5-48f1-989f-09d72908c13f
            post_view_4751263: '2'
            s: NjM4ODgxLCwxNjI4MzQyNjAzOTM1LCxodHRwczovL3N0YXRpYy5xaWRpYW5sYS5jb20vd29zaGlwbV9kZWZfaGVhZF8xLmpwZywseWMsLDRkNDI0MzM0Y2U2NDQ2NDI5MThlNjFiZjNlZmQ5NjgzLTAtMQ%3D%3D
            t: MGJRTW5TU0xiU3M0TEY1QUg0N1NnTFhsWXVoYm5nOFlrbVM5MEpRbDEzaTI0TTk4NHFhTEZMSW1YZ0lnNEw0WU0wMXdhbVJFYTBmNnNrNDJpQUZRcG4xZXFwWHQwc3ZoL0Y2U0dhMHM0WTRrZ3RGU2dYMDM0WEU2OGU4b3FRTDA%3D
            wordpress_logged_in_41071e66c7856d347ba575b5339c5a86: 18144854885%7C1629552204%7CcnJRMC1LLCPnvL3ZEGLxFpuh3LXe1JeyovQ8OlsPvm6%7C3b42d3281e8bef80c1f7ef7c44ff0b7430bed59c80ff13f7e97cb93c3805feee
        headers:
            Accept: application/json, text/plain, */*
            Accept-Encoding: gzip, deflate
            Accept-Language: zh-CN,zh;q=0.9
            COMMON_ACCESS_TOKEN: MGJRTW5TU0xiU3M0TEY1QUg0N1NnTFhsWXVoYm5nOFlrbVM5MEpRbDEzaTI0TTk4NHFhTEZMSW1YZ0lnNEw0WU0wMXdhbVJFYTBmNnNrNDJpQUZRcG4xZXFwWHQwc3ZoL0Y2U0dhMHM0WTRrZ3RGU2dYMDM0WEU2OGU4b3FRTDA=
            COMMON_ACCESS_TOKEN_SECRET: NjM4ODgxLCwxNjI4MzQyNjAzOTM1LCxodHRwczovL3N0YXRpYy5xaWRpYW5sYS5jb20vd29zaGlwbV9kZWZfaGVhZF8xLmpwZywseWMsLDRkNDI0MzM0Y2U2NDQ2NDI5MThlNjFiZjNlZmQ5NjgzLTAtMQ==
            Connection: keep-alive
            Cookie: new_device_id=device_0ca45ac5-91b5-48f1-989f-09d72908c13f; isOverlayShowx=VVVV;
                Hm_lvt_b85cbcc76e92e3fd79be8f2fed0f504f=1628163442,1628172667,1628334320;
                dts_device_info=%7B%22device_id%22%3A%22device_0ca45ac5-91b5-48f1-989f-09d72908c13f%22%2C%22device_brand%22%3A%22%22%2C%22device_model%22%3A%22%22%2C%22client_type%22%3A%22pc%22%2C%22os_type%22%3A%22Win32%22%2C%22os_version%22%3A%22%22%2C%22network_type%22%3A%22%22%2C%22browser_type%22%3A%22Chrome%22%2C%22browser_version%22%3A%2291.0.4472.124%22%7D;
                article_index=; article_user_profile=article_recom_users@author_items;
                article_detail_normal=article_user_profile@article_items; _DAU=done%21;
                wordpress_logged_in_41071e66c7856d347ba575b5339c5a86=18144854885%7C1629552204%7CcnJRMC1LLCPnvL3ZEGLxFpuh3LXe1JeyovQ8OlsPvm6%7C3b42d3281e8bef80c1f7ef7c44ff0b7430bed59c80ff13f7e97cb93c3805feee;
                t=MGJRTW5TU0xiU3M0TEY1QUg0N1NnTFhsWXVoYm5nOFlrbVM5MEpRbDEzaTI0TTk4NHFhTEZMSW1YZ0lnNEw0WU0wMXdhbVJFYTBmNnNrNDJpQUZRcG4xZXFwWHQwc3ZoL0Y2U0dhMHM0WTRrZ3RGU2dYMDM0WEU2OGU4b3FRTDA%3D;
                s=NjM4ODgxLCwxNjI4MzQyNjAzOTM1LCxodHRwczovL3N0YXRpYy5xaWRpYW5sYS5jb20vd29zaGlwbV9kZWZfaGVhZF8xLmpwZywseWMsLDRkNDI0MzM0Y2U2NDQ2NDI5MThlNjFiZjNlZmQ5NjgzLTAtMQ%3D%3D;
                firstVisitTime=1628342605147; post_view_4751263=2; Hm_lpvt_b85cbcc76e92e3fd79be8f2fed0f504f=1628342649
            Host: www.woshipm.com
            Referer: http://www.woshipm.com/u/801994
            User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
                (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
            X-WP-Nonce: 452000896a
        method: GET
        params:
            authorIds: ${author_id}
        url: /api2/user/followings/status
    extract:
        - request_id: body.REQUEST_ID
    validate:
    -   eq:
        - status_code
        - 200
    -   eq:
        - headers.Content-Type
        - application/json;charset=UTF-8
    -   eq:
        - body.CODE
        - 200
    -   eq:
        - body.MESSAGE
        - 请求成功
    -   eq:
        - body.REQUEST_ID
        - ${request_id}
    -   eq:
        - body.HOST_ID
        - localhost

  开发测试 最新文章
pytest系列——allure之生成测试报告(Wind
某大厂软件测试岗一面笔试题+二面问答题面试
iperf 学习笔记
关于Python中使用selenium八大定位方法
【软件测试】为什么提升不了?8年测试总结再
软件测试复习
PHP笔记-Smarty模板引擎的使用
C++Test使用入门
【Java】单元测试
Net core 3.x 获取客户端地址
上一篇文章      下一篇文章      查看所有文章
加:2021-08-23 16:59:40  更:2021-08-23 17:00:39 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/17 22:37:21-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码