JMeter 常见问题

作者: 云层_ | 来源:发表于2018-11-30 17:17 被阅读32次

    1、jmeter 的 “消息体数据” 无法点击:

         解决:parameters跟body data的方式两者只可选择其一,当一种方式下有数据时就无法使用另外一种,必须清空。

    2、运行失败,响应体提示报500 :  

            报错: {"status":500,"message":"Content type 'text/plain;charset=UTF-8' not supported"} 等类似情况,如下图

            解决:网上找了很多解决方法都不管用,其实解决起来很简单,添加请求信息头(content-type,application/json),如下图

                        PS: content-type根据需要的情况选择,不区分大小写;

    content-type: application/json

    3、参数 和消息体是两种形式,只能选择其中一种,使用后者能200,前者会报500

            报错:{"status":500,"message":"JSON parse error: Unrecognized token 'username': was expecting ('true', 'false' or 'null'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'username': was expecting ('true', 'false' or 'null')\n at [Source: (PushbackInputStream); line: 1, column: 10]"}

            解决

                        1)原因解析:参数,用于get 或put请求;消息体用于post    请求;

                        2)解决:把post请求的消息体参数放在 消息体里,见上一个常见问题的截图;

    若有其他问题,参考 http://www.cnblogs.com/hiln/p/9463134.html

    相关文章

      本文标题:JMeter 常见问题

      本文链接:https://www.haomeiwen.com/subject/kguhcqtx.html