%%
Last Updated:
- [[2021-02-10]]
%%
## Creating a recorder
- Right click on the Workbench > Add > Non-Test Elements > HTTP(S) Test Script Recorder.
- Click on the recorder. Make note of the port specified in the Global Settings option. You'll need to set up your browser to run traffic through this port later.
- In HTTP Sampler settings, select HTTPClient4.
- Make sure that the "Retrieve all embedded resources" option is ticked.
- You can also specify URL pattern to include/exclude.
## Creating a recording controller.
Even though you have a recorder, nothing will be captured without a place to put the data in. This is a recording controller (Add > Logic Controller > Recording Controller). The recording controller doesn't really have to be under the recorder or in the Workbench. It can be anywhere!
## Creating a Listener
Make sure that you have a listener set up under the Workbench section. Otherwise, the data will be captured in the recording controller, but you won't be able to see the response data from the recording – you would have to play it back, and by then it might replay differently.
## Setting up a proxy in your browser.
- Open up the browser you want to do recording on. JMeter should be able to record from any browser, as long as you can change the proxy settings on it so that the recorder picks up the requests.
- Go to your browser's settings.
- **Internet Explorer**: Cog wheel > Internet options > Connections tab > LAN Settings. Tick __Use a proxy server for your LAN.__. In the address field, type localhost and in port type the port number specified in the recorder in JMeter.
- **Chrome**: Options > Settings > Show advanced settings > Network section > Change proxy settings.
- **Firefox**: Options > Options > Advanced tab > Network tab > Connection section > Settings.
- There's an addon in Firefox (Elite Switcher) which makes the toggling of this proxy setting a lot easier. You can just click it on and off at will.
- IE and Chrome seem to share the same proxy settings.
## Optional: Save the .jtl file of recordings to be able to look through them later.
- Click on the View Results Tree listener. In the __Write results to file / Read from file__ section, type something like this in the filename: `${pathtoproject}/Recording_{__time(YYYYMMdd_hhmmss)}.jtl` .
- You'll have to define the path to the project as a variable first. The time variable is a standard JMeter one. This will allow you to save the results automatically. Otherwise, you either have to do it manually each time OR you won't save them. Every time JMeter is closed, you lose any unsaved results.
## Start the recording
- Go back to JMeter and click Start on the recorder. Start browsing on the browser with the proxy settings set up. All requests will come through on the recording controller. You can move the data from there to any transaction controller for organisation during the recording.
- When you're done, click Stop. That's it!