JMeter Proxy exclusion patterns still being recorded

女生的网名这么多〃 提交于 2021-02-06 15:00:20

问题


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)

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?


回答1:


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.

Solution:
Change the pattern to support trailing characters .*\.css.*

Explained
.* Any character
\. Matching the . (dot) character
css The character sequence css
.* Any character




回答2:


Maybe you can do the oposite: leave blank the URL Patterns to exclude and negate those patterns in the URL Patterns to Include box:

(?!..(bmp|css|js|gif|ico|jpe?g|png|swf|woff))(.)



来源:https://stackoverflow.com/questions/19033547/jmeter-proxy-exclusion-patterns-still-being-recorded

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!