The browser recorder lets you generate a k6 script based on a browser session.
New Browser Recorder
For new users, check out the latest browser recorder, which is also free and lets you auto-generate the k6 script.
Before you start, consider the following:
- 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.
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.