【jmeter--beanshell取样器】
String apiResultDataString = "${apiResultData}" ;
最终得到的是:
String apiResultDataString = "{"success":true,"errorCode":"S0000","errorMsg":null,"msgData":{"deliverTmDto":[{"business":"01","businessDesc":"测试1","deliver":null,"fe":null,"search":"1","closeTime":null,"specialDisplay":null}}" ;
【jmeter报错】**Error invoking bsh method: eval In file: inline evaluation of: ``String apiResultDataString = **
【原因】:在Java中,字符串是以最近两个双引号为一个整体,当出现这种格式的时,双引号就“配对”错误。
解决方案:对Json里的数据进行转义,即在错误的双引号位置加个 \ 进行转义。在线转义工具
07-01
524
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-04