写点什么

软件测试学习笔记丨 Charles_Mock 实战

作者:测试人
  • 2024-01-29
    北京
  • 本文字数:9718 字

    阅读完需:约 32 分钟

Charles_Mock 实战

1. 电脑端抓包

  • 抓取雪球 Web 端搜索接口数据



  • 查看接口响应状态码与使用的协议版本



  • 查看请求参数与 json 格式的响应内容



  • 快速过滤雪球域名的接口



  • 进行弱网测试,选择弱网模式为 256 kbps


    Proxy → Throttle Setting,然后选择 Enable Throttling



  • 弱网前



  • 弱网后



2. App 抓包

  1. 抓取雪球 app 自选–行情–A 股–涨幅榜股票列表的接口数据



  • 查看请求参数与 json 格式的响应内容



  • 进行弱网测试,选择弱网模式为 256 kbps

  • 弱网前



  • 弱网后



3. mock 测试

  1. 使用雪球 app 自选–行情–A 股–涨幅榜股票列表的接口数据

  2. Rewrite:

  3. 把列表中第一个股票名称改为自己的名字。 把列表中第二个股票的代码改为 hogwarts。




  • Map Local:

  1. 把列表中第一个股票名称改为自己的名字。

  2. 把列表中第二个股票的代码改为 hogwarts。

  3. 把列表中第三支股票的 type 改为 30。



{    "data": {        "items": [            {                "market": {                    "status_id": 5,                    "region": "CN",                    "status": "交易中",                    "time_zone": "Asia/Shanghai",                    "time_zone_desc": null,                    "delay_tag": 0                },                "quote": {                    "symbol": "SH601127",                    "code": "601127",                    "exchange": "SH",                    "name": "hogwarts",                    "type": 11,                    "sub_type": "ASH",                    "status": 1,                    "current": 66.86,                    "currency": "CNY",                    "percent": 0.39,                    "chg": 0.26,                    "timestamp": 1705299308640,                    "time": 1705299308640,                    "lot_size": 100,                    "tick_size": 0.01,                    "open": 66,                    "last_close": 66.6,                    "high": 68.15,                    "low": 65.5,                    "avg_price": 67.242,                    "volume": 29195868,                    "amount": 1963200162,                    "turnover_rate": 1.93,                    "amplitude": 3.98,                    "market_capital": 100944037424,                    "float_market_capital": 100944037424,                    "total_shares": 1509782193,                    "float_shares": 1509782193,                    "issue_date": 1465920000000,                    "lock_set": null,                    "current_year_percent": -12.26,                    "high52w": 99.97,                    "low52w": 24.75,                    "limit_up": 73.26,                    "limit_down": 59.94,                    "volume_ratio": 0.79,                    "eps": -2.29,                    "pe_ttm": -29.6,                    "pe_forecast": -33.397,                    "pe_lyr": -26.659,                    "navps": 6.15,                    "pb": 10.872,                    "dividend": null,                    "dividend_yield": null,                    "profit": -3831866371.22,                    "profit_four": -3451123826.64,                    "profit_forecast": -3058723002,                    "pledge_ratio": 10.92,                    "goodwill_in_net_assets": 0.7009750021532355,                    "timestamp_ext": null,                    "current_ext": null,                    "volume_ext": null,                    "traded_amount_ext": null,                    "no_profit": null,                    "no_profit_desc": null,                    "weighted_voting_rights": null,                    "weighted_voting_rights_desc": null,                    "is_registration": "N",                    "is_registration_desc": "否",                    "is_vie": null,                    "is_vie_desc": null,                    "security_status": null                },                "others": {                    "cyb_switch": true                },                "tags": []            },            {                "market": {                    "status_id": 5,                    "region": "CN",                    "status": "交易中",                    "time_zone": "Asia/Shanghai",                    "time_zone_desc": null,                    "delay_tag": 0                },                "quote": {                    "symbol": "SH601919",                    "code": "601919",                    "exchange": "SH",                    "name": "茅台",                    "type": 11,                    "sub_type": "ASH",                    "status": 1,                    "current": 9.79,                    "currency": "CNY",                    "percent": 3.16,                    "chg": 0.3,                    "timestamp": 1705299308820,                    "time": 1705299308820,                    "lot_size": 100,                    "tick_size": 0.01,                    "open": 9.64,                    "last_close": 9.49,                    "high": 9.99,                    "low": 9.63,                    "avg_price": 9.833,                    "volume": 132091107,                    "amount": 1298856101,                    "turnover_rate": 1.04,                    "amplitude": 3.79,                    "market_capital": 157335655392,                    "float_market_capital": 124898321122,                    "total_shares": 16071057752,                    "float_shares": 12757744752,                    "issue_date": 1182787200000,                    "lock_set": null,                    "current_year_percent": 2.19,                    "high52w": 10.39,                    "low52w": 8.2848,                    "limit_up": 10.44,                    "limit_down": 8.54,                    "volume_ratio": 1.59,                    "eps": 2.13,                    "pe_ttm": 4.588,                    "pe_forecast": 5.346,                    "pe_lyr": 1.436,                    "navps": 12.56,                    "pb": 0.779,                    "dividend": 1.909,                    "dividend_yield": 19.499,                    "profit": 109594742014.79,                    "profit_four": 34289163026.78,                    "profit_forecast": 29428119658,                    "pledge_ratio": null,                    "goodwill_in_net_assets": 3.0927544744845212,                    "timestamp_ext": null,                    "current_ext": null,                    "volume_ext": null,                    "traded_amount_ext": null,                    "no_profit": null,                    "no_profit_desc": null,                    "weighted_voting_rights": null,                    "weighted_voting_rights_desc": null,                    "is_registration": "N",                    "is_registration_desc": "否",                    "is_vie": null,                    "is_vie_desc": null,                    "security_status": null                },                "others": {                    "cyb_switch": true                },                "tags": []            },            {                "market": {                    "status_id": 5,                    "region": "CN",                    "status": "交易中",                    "time_zone": "Asia/Shanghai",                    "time_zone_desc": null,                    "delay_tag": 0                },                "quote": {                    "symbol": "SH603099",                    "code": "603099",                    "exchange": "SH",                    "name": "长白山",                    "type": 30,                    "sub_type": "ASH",                    "status": 1,                    "current": 30,                    "currency": "CNY",                    "percent": 10,                    "chg": 3.15,                    "timestamp": 1705299288500,                    "time": 1705299288500,                    "lot_size": 100,                    "tick_size": 0.01,                    "open": 30.99,                    "last_close": 31.51,                    "high": 34.66,                    "low": 30.48,                    "avg_price": 33.573,                    "volume": 44730821,                    "amount": 1501726055,                    "turnover_rate": 16.77,                    "amplitude": 13.27,                    "market_capital": 9242782200,                    "float_market_capital": 9242782200,                    "total_shares": 266670000,                    "float_shares": 266670000,                    "issue_date": 1408636800000,                    "lock_set": null,                    "current_year_percent": 131.38,                    "high52w": 34.66,                    "low52w": 8.99,                    "limit_up": 34.66,                    "limit_down": 28.36,                    "volume_ratio": 1.46,                    "eps": 0.45,                    "pe_ttm": 77.137,                    "pe_forecast": 45.712,                    "pe_lyr": -161.064,                    "navps": 3.96,                    "pb": 8.753,                    "dividend": null,                    "dividend_yield": null,                    "profit": -57385619.31,                    "profit_four": 119822235.52,                    "profit_forecast": 202195214,                    "pledge_ratio": 29.72,                    "goodwill_in_net_assets": null,                    "timestamp_ext": null,                    "current_ext": null,                    "volume_ext": null,                    "traded_amount_ext": null,                    "no_profit": null,                    "no_profit_desc": null,                    "weighted_voting_rights": null,                    "weighted_voting_rights_desc": null,                    "is_registration": "N",                    "is_registration_desc": "否",                    "is_vie": null,                    "is_vie_desc": null,                    "security_status": null                },                "others": {                    "cyb_switch": true                },                "tags": []            },            {                "market": {                    "status_id": 5,                    "region": "CN",                    "status": "交易中",                    "time_zone": "Asia/Shanghai",                    "time_zone_desc": null,                    "delay_tag": 0                },                "quote": {                    "symbol": "SH603628",                    "code": "603628",                    "exchange": "SH",                    "name": "清源股份",                    "type": 11,                    "sub_type": "ASH",                    "status": 1,                    "current": 24.48,                    "currency": "CNY",                    "percent": -3.13,                    "chg": -0.79,                    "timestamp": 1705299306290,                    "time": 1705299306290,                    "lot_size": 100,                    "tick_size": 0.01,                    "open": 25.88,                    "last_close": 25.27,                    "high": 26.34,                    "low": 22.74,                    "avg_price": 24.441,                    "volume": 58129000,                    "amount": 1420751273,                    "turnover_rate": 21.23,                    "amplitude": 14.25,                    "market_capital": 6702624000,                    "float_market_capital": 6702624000,                    "total_shares": 273800000,                    "float_shares": 273800000,                    "issue_date": 1484150400000,                    "lock_set": null,                    "current_year_percent": 16.57,                    "high52w": 27.55,                    "low52w": 10.67,                    "limit_up": 27.8,                    "limit_down": 22.74,                    "volume_ratio": 1.13,                    "eps": 0.68,                    "pe_ttm": 36.032,                    "pe_forecast": 34.684,                    "pe_lyr": 61.278,                    "navps": 4.46,                    "pb": 5.489,                    "dividend": 0.08,                    "dividend_yield": 0.327,                    "profit": 109380815.33,                    "profit_four": 186016884.68,                    "profit_forecast": 193250482,                    "pledge_ratio": 3.16,                    "goodwill_in_net_assets": null,                    "timestamp_ext": null,                    "current_ext": null,                    "volume_ext": null,                    "traded_amount_ext": null,                    "no_profit": null,                    "no_profit_desc": null,                    "weighted_voting_rights": null,                    "weighted_voting_rights_desc": null,                    "is_registration": "N",                    "is_registration_desc": "否",                    "is_vie": null,                    "is_vie_desc": null,                    "security_status": null                },                "others": {                    "cyb_switch": true                },                "tags": []            },            {                "market": {                    "status_id": 5,                    "region": "CN",                    "status": "交易中",                    "time_zone": "Asia/Shanghai",                    "time_zone_desc": null,                    "delay_tag": 0                },                "quote": {                    "symbol": "SZ000661",                    "code": "000661",                    "exchange": "SZ",                    "name": "长春高新",                    "type": 11,                    "sub_type": "1",                    "status": 1,                    "current": 122.6,                    "currency": "CNY",                    "percent": -1.92,                    "chg": -2.4,                    "timestamp": 1705299309000,                    "time": 1705299309000,                    "lot_size": 100,                    "tick_size": 0.01,                    "open": 125.1,                    "last_close": 125,                    "high": 125.82,                    "low": 122.38,                    "avg_price": 123.911,                    "volume": 9557528,                    "amount": 1184287437,                    "turnover_rate": 2.38,                    "amplitude": 2.75,                    "market_capital": 49610701774,                    "float_market_capital": 49284320590,                    "total_shares": 404654990,                    "float_shares": 401992827,                    "issue_date": 850838400000,                    "lock_set": null,                    "current_year_percent": -15.91,                    "high52w": 218.068,                    "low52w": 122,                    "limit_up": 137.5,                    "limit_down": 112.5,                    "volume_ratio": 1.58,                    "eps": 10.6,                    "pe_ttm": 11.57,                    "pe_forecast": 10.3,                    "pe_lyr": 11.983,                    "navps": 52.72,                    "pb": 2.325,                    "dividend": 1,                    "dividend_yield": 0.816,                    "profit": 4140114115.74,                    "profit_four": 4287921797.67,                    "profit_forecast": 4816565454,                    "pledge_ratio": 9.4,                    "goodwill_in_net_assets": 0.25028613346206063,                    "timestamp_ext": null,                    "current_ext": null,                    "volume_ext": null,                    "traded_amount_ext": null,                    "no_profit": "N",                    "no_profit_desc": "已盈利",                    "weighted_voting_rights": "N",                    "weighted_voting_rights_desc": "无差异",                    "is_registration": "N",                    "is_registration_desc": "否",                    "is_vie": "N",                    "is_vie_desc": "否",                    "security_status": null                },                "others": {                    "cyb_switch": true                },                "tags": []            },            {                "market": {                    "status_id": 5,                    "region": "CN",                    "status": "交易中",                    "time_zone": "Asia/Shanghai",                    "time_zone_desc": null,                    "delay_tag": 0                },                "quote": {                    "symbol": "SZ000715",                    "code": "000715",                    "exchange": "SZ",                    "name": "韦奇2",                    "type": 11,                    "sub_type": "1",                    "status": 1,                    "current": 11.07,                    "currency": "CNY",                    "percent": 7.06,                    "chg": 0.73,                    "timestamp": 1705299312000,                    "time": 1705299312000,                    "lot_size": 100,                    "tick_size": 0.01,                    "open": 9.9,                    "last_close": 10.34,                    "high": 11.37,                    "low": 9.9,                    "avg_price": 10.89,                    "volume": 119899807,                    "amount": 1305452147,                    "turnover_rate": 28.89,                    "amplitude": 14.22,                    "market_capital": 4602008666,                    "float_market_capital": 4594708599,                    "total_shares": 415718940,                    "float_shares": 415059494,                    "issue_date": 863020800000,                    "lock_set": null,                    "current_year_percent": 51.44,                    "high52w": 12.25,                    "low52w": 6.15,                    "limit_up": 11.37,                    "limit_down": 9.31,                    "volume_ratio": 2.62,                    "eps": 0.28,                    "pe_ttm": 39.143,                    "pe_forecast": 43.167,                    "pe_lyr": 53.746,                    "navps": 4.37,                    "pb": 2.533,                    "dividend": null,                    "dividend_yield": null,                    "profit": 85625744.93,                    "profit_four": 117570454.68,                    "profit_forecast": 106609080,                    "pledge_ratio": 23.14,                    "goodwill_in_net_assets": null,                    "timestamp_ext": null,                    "current_ext": null,                    "volume_ext": null,                    "traded_amount_ext": null,                    "no_profit": "N",                    "no_profit_desc": "已盈利",                    "weighted_voting_rights": "N",                    "weighted_voting_rights_desc": "无差异",                    "is_registration": "N",                    "is_registration_desc": "否",                    "is_vie": "N",                    "is_vie_desc": "否",                    "security_status": null                },                "others": {                    "cyb_switch": true                },                "tags": []            }        ],        "items_size": 6    },    "error_code": 0,    "error_description": ""}
复制代码

霍格沃兹的测试管理班是专门面向测试与质量管理人员的一门课程,通过提升从业人员的团队管理、项目管理、绩效管理、沟通管理等方面的能力,使测试管理人员可以更好的带领团队、项目以及公司获得更快的成长。提供 1v1 私教指导,BAT 级别的测试管理大咖量身打造职业规划。


发布于: 39 分钟前阅读数: 5
用户头像

测试人

关注

专注于软件测试开发 2022-08-29 加入

霍格沃兹测试开发学社,测试人社区:https://ceshiren.com/t/topic/22284

评论

发布
暂无评论
软件测试学习笔记丨Charles_Mock实战_软件测试_测试人_InfoQ写作社区