JMeter also enables you to manually configure your workspace. It’s more complex, but you can make the scripts fit your exact needs.
Configure your browser proxy
The “WorkBench” branch can be used as a temporary workspace for creating scripts. Bear in mind that entries added to this section will not be saved with the test plan. Therefore, if you want to reuse the same recording configuration in the future, you will need to copy and paste it to the “Test Plan” section.
On the “HTTP(S) Test Script Recorder” configuration page in “Global Settings: Port”, you need to put the same port that is specified into your browser’s proxy configuration, for example 8080.
If you want to exclude requests to specific resources, you can use the “URL Patterns to Exclude” section. This can be useful if you want to include only the types of content you want to request (e.g. *.html, *.php, etc) or to exclude the types of content you do not want to request (e.g. *.jpg, *.png, *.js, etc).
When would we use this? For example, when recording a script that calls a third-party application or when testing a server-side script, you might not want to download assets since they might clutter up your tests and consume bandwidth, or you might want to record certain requests from a certain path.
The most common exclude patterns are: “..png“, “..jpg“, “..gif“, “..css”, “..js”. You can also combine different patterns together. This combined pattern should get rid of all redundant requests that might distract you from important ones: “..(bmp|css|js|gif|ico|jpe?g|png|swf|woff)”
In this case, it is recommended to download all the embedded resources in the script: Right click on “Test Plan” -> “Add” -> “Config Element” -> “HTTP Request Defaults” -> “Advanced” -> select “Retrieve All Embedded Resources” checkbox.
To make JMeter behave more like a real browser it is recommended to add the “HTTP Cache Manager”, which lets you simulate browser caching functionality in your performance tests. Right click on “Test Plan” -> “Add” -> “Config Element” -> “HTTP Cache Manager”.
Now click on the ‘Start’ button, which is at the bottom of the “HTTP(S) Test Script Recorder” page, and go through the web application workflow you want to test. When you go back to JMeter, you should see all the captured requests from your browser under the “Recording Controller”.