jmeter常见错误(持续更新)

1. jmeter java.net.NoRouteToHostException: Cannot assign requested address (Address not available)

压测过程中出现此错误,发现网络连接正常,服务器也是正常,网上查是客户端(jmeter机器)端口用尽.因为socket端口释放需要等待,默认是2min.
我用gui客户端,所以在对应的http请求,取消勾选"keep alive"

2. 用jtl生成html报告

1)打开dos,进入到jmeter的bin目录下
2)运行命令:jmeter -g ./Log/test.jtl -o output

3. jmeter 设置线程后等待用sampler--flow control action,这个只会紧跟在上一个sampler之后等待.

而timer定时器,是在线程开始前等待,不管放在什么位置.

4.想提取响应中的数组,进行遍历

如提取data.children[]..title;data.children[]..type;data.children[*]..route;组成3个数组,然后遍历这3个数组

{
    "code": 0,
    "data": {
        "title": "一级导航栏",
        "type": "APP_TABS",
        "route": null,
        "children": [
            {
                "title": "聊一聊",
                "type": "ORIGINAL_CHAT_TAB",
                "route": null,
                "properties": null
            },
            {
                "title": "云块",
                "type": "eEGrQHv5",
                "route": null,
                "properties": null
            },
            {
                "title": "新赞品",
                "type": "CUSTOM_H5_TAB",
                "route": "https://appstore.onecloud.cn?need_toolbar=false",
                "properties": null
            },
            {
                "title": "布局我的",
                "type": "r66g2O8R",
                "route": null,
                "properties": null
            }
        ],
        "properties": null
    },
    "message": "success"
}

用json提取器结合2个for each控制器实现

原文地址:https://www.cnblogs.com/xiaozhuangAna/p/13396219.html