首页 > 其他分享 >软件测试学习笔记丨Charles_Mock实战

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

时间:2024-01-29 18:03:18浏览次数:30  
标签:status profit 软件测试 Charles current ext null Mock desc

Charles_Mock实战

1. 电脑端抓包

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

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

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

软件测试学习笔记丨Charles_Mock实战_测试开发_02

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

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

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

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

  • 进行弱网测试,选择弱网模式为 256 kbps
    Proxy → Throttle Setting,然后选择 Enable Throttling

软件测试学习笔记丨Charles_Mock实战_自动化测试_05

  • 弱网前

软件测试学习笔记丨Charles_Mock实战_自动化测试_06

  • 弱网后

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

2. App 抓包

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

软件测试学习笔记丨Charles_Mock实战_自动化测试_08

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

软件测试学习笔记丨Charles_Mock实战_自动化测试_09

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

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

  • 弱网后

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

3. mock 测试

  1. 使用雪球 app 自选–行情–A 股–涨幅榜股票列表的接口数据
  2. Rewrite:
  1. 把列表中第一个股票名称改为自己的名字。
  2. 把列表中第二个股票的代码改为 hogwarts。

软件测试学习笔记丨Charles_Mock实战_自动化测试_12

软件测试学习笔记丨Charles_Mock实战_自动化测试_13

  • Map Local:
  1. 把列表中第一个股票名称改为自己的名字。
  2. 把列表中第二个股票的代码改为 hogwarts。
  3. 把列表中第三支股票的 type 改为 30。

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

{
    "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 级别的测试管理大咖量身打造职业规划。

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

标签:status,profit,软件测试,Charles,current,ext,null,Mock,desc
From: https://blog.51cto.com/u_16547786/9471456

相关文章

  • 每日(软件测试分类)
    (一)软件测试的定义在规定的条件下对程序进行操作,以发现程序的错误,衡量软件质量,并对其是否能满足设计要求进行评估的过程。1规定条件-->测试用例2发现程序的错误-->找bug3衡量软件质量-->根据各项指标评估软件的质量4满足设计要求-->是否满足用户需求、需求规格说明书......
  • 每日(软件测试模型)
    (三)软件测试的原则1、测试应该尽早进行,最好在需求阶段就开始介入,因为最严重的错误不外乎是系统不能满足用户的需求。2、程序员(开发)应该避免检查自己的程序,软件测试应该由第三方(测试人员)来负责。3、设计测试用例时应考虑到合法的输入和不合法的输入。4、在测试程序时,不仅要检验程......
  • 每日(软件测试生命周期)
     什么是生命周期?“生命周期”这个简单的词是指从一个形式(状态)到另外一个形式(状态)的一系列的变化。这些变化可以发生有形或无形的事情上。每个实体都有生命周期,从开始到死亡/结束。类似的,软件也是个实体。就像开发软件包括一系列的步骤,测试也有很多步骤,这些步骤按照一定顺序去......
  • 软件测试活动中,如何评估测试范围?
    前言大家好,我是chowley,今天来讲一讲——如何评估软件测试范围在软件开发的不同阶段,评估测试范围是确保测试活动有效性和效率的关键步骤。测试范围的明确定义有助于确定测试目标、提高测试覆盖率,并确保在有限的时间内实现最大的测试价值。本文将深入探讨在软件测试中如何评估测试......
  • 软件测试|从零到一:我的测试开发工程师之路
    测试管理班是专门面向测试与质量管理人员的一门课程,通过提升从业人员的团队管理、项目管理、绩效管理、沟通管理等方面的能力,使测试管理人员可以更好的带领团队、项目以及公司获得更快的成长。提供1v1私教指导,BAT级别的测试管理大咖量身打造职业规划。本文为霍格沃兹测试开......
  • 软件测试/测试开发|Pytest allure为测试用例添加标题
    前言在测试过程中,清晰的测试报告对于了解测试结果和问题定位非常关键。如何使用pytest和Allure报告创建清晰的测试报告,本文将介绍通过使用allure.title来增强测试报告的可读性。allure.title的三种使用方式直接使用@allure.title为测试用例自定义标题;@allure.title支持通过占......
  • charles的安装和使用
    一、安装charlesformaccharles4.0.2免费下载:链接:https://pan.baidu.com/s/1MVdnfslLhMTeSy_phrp2jA提取码:25mr(上次分享的不小心删了不好意思)下载好后,解压,将安装包拖到应用程序里,双击进行安装,(谁都会哈哈),然后重点来了,记好笔记!!!打开后,会提示还有30天使用期限,没事,在强大的......
  • 软件测试/测试开发|给你剖析闭包与装饰器的魔力
    测试管理班是专门面向测试与质量管理人员的一门课程,通过提升从业人员的团队管理、项目管理、绩效管理、沟通管理等方面的能力,使测试管理人员可以更好的带领团队、项目以及公司获得更快的成长。提供1v1私教指导,BAT级别的测试管理大咖量身打造职业规划。闭包与装饰器函数引......
  • 软件测试/测试开发|给你剖析闭包与装饰器的魔力
    闭包与装饰器函数引用讲解闭包之前,需要理解一个概念,Python中定义的函数,也可以像变量一样,将一个函数名,赋值给另一个变量名,赋值后,此变量名就可以做为该函数的一个别名使用,进行调用函数,此功能在讲解列表操作的sort()方法时使用过,sort()方法的key参数传入的就是一个函数名。defsho......
  • 单元测试中如何Mock HttpContext
    最近团队有小伙伴问在单元测试中如何MockHttpContext.这是一个好问题,整理了一个实现方案分享给大家。在C#中,尤其是在单元测试场景下,模拟(Mocking)HttpContext是一种常见的做法。这允许我们在没有实际HTTP请求的情况下测试与HTTP上下文相关的代码。为了模拟HttpContext,我们通常......