jmeter响应断言无法处理中文的问题

在jmeter中我使用了响应断言,判断报文中是否存在该字符串

响应断言中使用的函数为:

${_StringFromFile(F:\jmeter_test\srcField.txt,,,)}


srcField.txt中的内容为:

百度一下


执行之后显示响应断言为乱码,显示如下:

Assertion error: false
Assertion failure: true
Assertion failure message: Test failed: text expected to contain /鐧惧害涓�涓�/


后来在网上找了资料,发现只能在jmeter.properties中将编码格式再改为gbk

sampleresult.default.encoding=gbk


虽然响应断言正常了,但是报文却又乱码了。


问题是解决了,但是这个编码不能没事就改吧。

硬伤啊,希望jmeter之后能解决这个问题。



猜你喜欢

转载自blog.csdn.net/eagle1024/article/details/77921583
今日推荐