The browser recorder lets you generate a k6 script based on a browser session. It's available as an extension for Chrome and Firefox.
Before you start
Before you start, consider the following:
How to record
The recorder is free to use
The browser recorder requires a k6 Cloud account, but you do not need an active k6 Cloud subscription.
When you finish recording the session, the browser extension uploads the auto-generated k6 test into your k6 Cloud account. You can then copy the script to edit it in your local IDE and run the test locally using the k6 run command.
- Install the Chrome or Firefox extension.
- Open the extension by clicking the k6 logo.
- Select Start recording to begin recording the current browser tab.
- When done, select Stop recording. You'll be taken to the app to review the recorded test script.
- Save the recorded script in any of your projects.
To include some of the requests in the third party list, deselect the ones you want to include.
- Edit your script as necessary. Depending on the type of load test, you might need to change different aspects of the script. Typical changes are for load options and to handle correlation and dynamic data.
- Run the test locally or in k6 Cloud.
- To run a test from the k6 Cloud UI, select Run to start the test.
- To use the k6 CLI to run a local or cloud test, copy the generated script to your local text editor and execute the k6 run or k6 cloud command to start the test.
For more about running k6, refer to the Running k6 guide.
Trouble? Try the HAR converter
Some users have reported 413 errors when they try to upload long recordings. In these cases, the easiest fix is to use the HAR converter, which creates a k6 script from the HTTP requests included in a HAR file (it also powers the browser recorder).
Besides avoiding the 413 error, the HAR converter catches some edge-case behavior that the browser recorder won't. For example, the browser extension doesn't record other tabs or pop-up windows.
If you need to capture this information or are having a problem recording a request, try the HAR converter. If the error persists with the HAR converter, please provide detailed information about the problem in a new issue.