JMeter代理排除模式仍在记录中 [英] JMeter Proxy exclusion patterns still being recorded
问题描述
我正在使用JMeter在我的浏览器中记录流量.在我要排除的网址格式中:
I am using JMeter to record traffic in my browser. In my URL Patterns to Exclude are:
.*\.jpg
,
.*\.js
,
.*\.png
似乎应该阻止这些模式(我什至已使用正则表达式测试器进行了测试,此处 )
Which looks like they should block these patterns (I've even tested it with a regex tester here)
但是,我仍然看到其中许多文件被拉起.在相关论坛中,有人遇到了类似的问题,但原因是此后再添加了其他网址参数(例如,www.website.com/image.jpg?asdf = thisdoesntmatch).但是,这里似乎并非如此.谁能指出我正确的方向?
Yet, I still see plenty of these files get pulled up. In a related forum someone had a similar issue, but his was caused by having additional url parameters afterwards (eg www.website.com/image.jpg?asdf=thisdoesntmatch). However this doesn't seem to be the case here. Can anyone point me in the right direction?
推荐答案
正如问题注释中已经提到的那样,尾随字符可能是一个问题.模式匹配器针对包含参数的完整url执行.
因此,URL http://example.com/layout.css?id=123
与模式.*\.css
不匹配.
JMeter HTTP请求样本将 Path 和 Parameters 分开因此当您查看该URL时可能并不明显.
As already mentioned in the question comments it is probably a problem with the trailing characters. The pattern matcher is executed against the complete url including parameters.
So an URL http://example.com/layout.css?id=123
is not matched against the pattern .*\.css
The JMeter HTTP Request Sample seperates the Path and the Parameters so it might be not obvious when you look at the URL.
解决方案:
更改模式以支持尾随字符.*\.css.*
解释
.*
任何字符
\.
匹配. (点)字符
css
字符序列css
.*
任何字符
Explained
.*
Any character
\.
Matching the . (dot) character
css
The character sequence css
.*
Any character
这篇关于JMeter代理排除模式仍在记录中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!