From 15d11773a58e6900bdf6feb1e4a823dc4edff812 Mon Sep 17 00:00:00 2001 From: Pepe Cano <825430+ppcano@users.noreply.github.com> Date: Mon, 15 May 2023 12:22:20 +0200 Subject: [PATCH 1/7] Restructure `Recording a session` docs --- gatsby-node.js | 20 ++++++++++++++++++ ....md => 02 Create tests from recordings.md} | 2 +- .../01 Using the browser recorder.md} | 2 +- .../02 Using the HAR converter.md} | 2 +- .../images/Recording-a-test-script/step-2.png | Bin .../images/Recording-a-test-script/step-3.png | Bin .../images/Recording-a-test-script/step-4.png | Bin .../images/session_recorder_filter_domain.png | Bin .../session_recorder_filter_domain_list.png | Bin .../images/session_recorder_save_as_har.png | Bin 10 files changed, 23 insertions(+), 3 deletions(-) rename src/data/markdown/translated-guides/en/05 Test authoring/{02 Recording a session.md => 02 Create tests from recordings.md} (98%) rename src/data/markdown/translated-guides/en/05 Test authoring/{02 Recording a session/01 Browser recorder.md => 02 Create tests from recordings/01 Using the browser recorder.md} (98%) rename src/data/markdown/translated-guides/en/05 Test authoring/{02 Recording a session/02 Har converter.md => 02 Create tests from recordings/02 Using the HAR converter.md} (99%) rename src/data/markdown/translated-guides/en/05 Test authoring/{02 Recording a session => 02 Create tests from recordings}/images/Recording-a-test-script/step-2.png (100%) rename src/data/markdown/translated-guides/en/05 Test authoring/{02 Recording a session => 02 Create tests from recordings}/images/Recording-a-test-script/step-3.png (100%) rename src/data/markdown/translated-guides/en/05 Test authoring/{02 Recording a session => 02 Create tests from recordings}/images/Recording-a-test-script/step-4.png (100%) rename src/data/markdown/translated-guides/en/05 Test authoring/{02 Recording a session => 02 Create tests from recordings}/images/session_recorder_filter_domain.png (100%) rename src/data/markdown/translated-guides/en/05 Test authoring/{02 Recording a session => 02 Create tests from recordings}/images/session_recorder_filter_domain_list.png (100%) rename src/data/markdown/translated-guides/en/05 Test authoring/{02 Recording a session => 02 Create tests from recordings}/images/session_recorder_save_as_har.png (100%) diff --git a/gatsby-node.js b/gatsby-node.js index 7d0c47e048..04b44f15eb 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -1609,6 +1609,26 @@ const createRedirects = ({ actions }) => { isPermanent: true, }); + createRedirect({ + fromPath: '/test-authoring/recording-a-session/browser-recorder', + toPath: + '/test-authoring/create-tests-from-recordings/using-the-browser-recorder/', + isPermanent: true, + }); + + createRedirect({ + fromPath: '/test-authoring/recording-a-session/har-converter', + toPath: + '/test-authoring/create-tests-from-recordings/using-the-har-converter/', + isPermanent: true, + }); + + createRedirect({ + fromPath: '/test-authoring/recording-a-session', + toPath: '/test-authoring/create-tests-from-recordings/', + isPermanent: true, + }); + const redirects = { '/javascript-api/k6-http/cookiejar-k6-http': '/javascript-api/k6-http/cookiejar/', diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session.md b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md similarity index 98% rename from src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session.md rename to src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md index 28e9cd64f3..2b3c691a22 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md @@ -1,5 +1,5 @@ --- -title: 'Recording a session' +title: 'Create tests from recordings' excerpt: 'In load testing, recording usually refers to the process of creating a load test from the recording of a user session.' --- diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/01 Browser recorder.md b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md similarity index 98% rename from src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/01 Browser recorder.md rename to src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md index 581a4d536c..e780bda7b7 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/01 Browser recorder.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md @@ -1,5 +1,5 @@ --- -title: 'Browser recorder' +title: 'Using the browser recorder' excerpt: 'The browser recorder allows generating a k6 script based on a web session. It is available as extensions for Chrome and Firefox.' --- diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/02 Har converter.md b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/02 Using the HAR converter.md similarity index 99% rename from src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/02 Har converter.md rename to src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/02 Using the HAR converter.md index 95a5bfadd0..c708c04fd3 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/02 Har converter.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/02 Using the HAR converter.md @@ -1,5 +1,5 @@ --- -title: 'HAR converter' +title: 'Using the HAR converter' excerpt: 'The HAR converter is an alternative to the Browser recorder. It generates a k6 script based on the HTTP requests included on a HAR file.' --- diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/images/Recording-a-test-script/step-2.png b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/images/Recording-a-test-script/step-2.png similarity index 100% rename from src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/images/Recording-a-test-script/step-2.png rename to src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/images/Recording-a-test-script/step-2.png diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/images/Recording-a-test-script/step-3.png b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/images/Recording-a-test-script/step-3.png similarity index 100% rename from src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/images/Recording-a-test-script/step-3.png rename to src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/images/Recording-a-test-script/step-3.png diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/images/Recording-a-test-script/step-4.png b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/images/Recording-a-test-script/step-4.png similarity index 100% rename from src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/images/Recording-a-test-script/step-4.png rename to src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/images/Recording-a-test-script/step-4.png diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/images/session_recorder_filter_domain.png b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/images/session_recorder_filter_domain.png similarity index 100% rename from src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/images/session_recorder_filter_domain.png rename to src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/images/session_recorder_filter_domain.png diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/images/session_recorder_filter_domain_list.png b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/images/session_recorder_filter_domain_list.png similarity index 100% rename from src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/images/session_recorder_filter_domain_list.png rename to src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/images/session_recorder_filter_domain_list.png diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/images/session_recorder_save_as_har.png b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/images/session_recorder_save_as_har.png similarity index 100% rename from src/data/markdown/translated-guides/en/05 Test authoring/02 Recording a session/images/session_recorder_save_as_har.png rename to src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/images/session_recorder_save_as_har.png From 9a339e4ee7abdaec69a4e9a01dc469fe7eeefe8f Mon Sep 17 00:00:00 2001 From: Pepe Cano <825430+ppcano@users.noreply.github.com> Date: Mon, 15 May 2023 13:48:40 +0200 Subject: [PATCH 2/7] Update `Create tests from recordings` --- .../02 Create tests from recordings.md | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md index 2b3c691a22..cd50a7dbef 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md @@ -3,41 +3,42 @@ title: 'Create tests from recordings' excerpt: 'In load testing, recording usually refers to the process of creating a load test from the recording of a user session.' --- -Load tests should be realistic. -One way to create a realistic test is to use a _recording_ of a user session. -You can then use this recording to model the logic of your test. +One way to create tests is to use a _recording_ of a user session to auto-generate the test script. + +Recordings show the sequence of the session's requests and parameters. You can then use this recording to create the logic of your test. k6 provides two tools that can directly convert a recording into k6 script: -- [Browser recorder](/test-authoring/recording-a-session/browser-recorder) generates a k6 script from a browser session. Available for [Chrome](https://chrome.google.com/webstore/detail/k6-browser-recorder/phjdhndljphphehjpgbmpocddnnmdbda?hl=en) and [Firefox](https://addons.mozilla.org/en-US/firefox/addon/k6-browser-recorder/). +- [Browser recorder](/test-authoring/recording-a-session/browser-recorder) generates a k6 script from a browser session. - [HAR converter](/test-authoring/recording-a-session/har-converter) generates a k6 script from the requests included in a HAR file. -## Record instead of scripting -The recording process has three steps: +## Recordings to facilitate script creation + +Recorders allow you to avoid writing complex tests from scratch. +Testers commonly use recordings while testing advanced scenarios on websites or mobile applications, such as end-to-end (E2E) tests with dozens or hundreds of requests. + +The steps to create a load test from a recording are as follows: 1. Record a user or API session. 2. Convert the recorded session into a test. -3. Run the test. - -Recordings show the sequence of the session's requests and parameters, helping testers quickly build complex chains of requests. -For this reason, testers commonly use recordings while testing complex scenarios on websites or mobile applications. +3. Set up the load and test options. +4. Handle [correlation and dynamic data](/examples/correlation-and-dynamic-data/). -Suppose you have to create a performance test that simulates a user journey with dozens or hundreds of requests. -In such a case, the recording lets you avoid writing the test from scratch. +You can now debug or run the load test. ## Be sure to record realistically -Before you record your session, consider the following dos and don'ts. +If you record the session, consider the following dos and don'ts. It's a good idea to: -- Browse as a user would -- Take natural pauses that users would take to consume page content -- Focus on the most common use cases, rather than all the possible use cases +- Browse as a user would. +- Take natural pauses that users would take to consume page content. +- Focus on the most common use cases, rather than all the possible use cases. - Take note of pages where forms/logins occur. You will likely need to complete some scripting. You probably _do not_ want to: -- Visit every page in one journey -- Click every possible option -- Navigate as fast as you can -- Navigate out of your actual site or application +- Visit every page in one journey. +- Click every possible option. +- Navigate as fast as you can. +- Navigate out of your actual site or application. From 061372e8cbf21cd5e0732f797c9a0363043b9947 Mon Sep 17 00:00:00 2001 From: Pepe Cano <825430+ppcano@users.noreply.github.com> Date: Mon, 15 May 2023 16:24:04 +0200 Subject: [PATCH 3/7] Reedit create tests from recordings --- .../02 Create tests from recordings.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md index cd50a7dbef..7daf9f4137 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md @@ -3,20 +3,18 @@ title: 'Create tests from recordings' excerpt: 'In load testing, recording usually refers to the process of creating a load test from the recording of a user session.' --- -One way to create tests is to use a _recording_ of a user session to auto-generate the test script. +Recordings show the sequence of requests and parameters of a user session or API interactions. +You can then use this recording to auto-generate the logic of your test. -Recordings show the sequence of the session's requests and parameters. You can then use this recording to create the logic of your test. +Testers commonly use recordings to avoid writing complex tests from scratch. +For example, testing advanced scenarios on websites or mobile applications, such as end-to-end (E2E) tests with dozens or hundreds of requests. k6 provides two tools that can directly convert a recording into k6 script: - [Browser recorder](/test-authoring/recording-a-session/browser-recorder) generates a k6 script from a browser session. - [HAR converter](/test-authoring/recording-a-session/har-converter) generates a k6 script from the requests included in a HAR file. - -## Recordings to facilitate script creation - -Recorders allow you to avoid writing complex tests from scratch. -Testers commonly use recordings while testing advanced scenarios on websites or mobile applications, such as end-to-end (E2E) tests with dozens or hundreds of requests. +## Steps The steps to create a load test from a recording are as follows: @@ -25,7 +23,7 @@ The steps to create a load test from a recording are as follows: 3. Set up the load and test options. 4. Handle [correlation and dynamic data](/examples/correlation-and-dynamic-data/). -You can now debug or run the load test. +You can then debug or run the load test. ## Be sure to record realistically From 543ea1b62ed6acc44ebb3e0d5ff03d4615898708 Mon Sep 17 00:00:00 2001 From: Pepe Cano <825430+ppcano@users.noreply.github.com> Date: Tue, 16 May 2023 14:08:00 +0200 Subject: [PATCH 4/7] Complete Rewrite `Create tests from recordings` --- .../02 Create tests from recordings.md | 24 ++++++++++++++--- .../01 Using the browser recorder.md | 23 ++++++++-------- .../02 Using the HAR converter.md | 26 +++++-------------- 3 files changed, 40 insertions(+), 33 deletions(-) diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md index 7daf9f4137..980836716e 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md @@ -3,7 +3,7 @@ title: 'Create tests from recordings' excerpt: 'In load testing, recording usually refers to the process of creating a load test from the recording of a user session.' --- -Recordings show the sequence of requests and parameters of a user session or API interactions. +A recording stores the sequence of requests and parameters of a user session or API interactions. You can then use this recording to auto-generate the logic of your test. Testers commonly use recordings to avoid writing complex tests from scratch. @@ -27,16 +27,34 @@ You can then debug or run the load test. ## Be sure to record realistically -If you record the session, consider the following dos and don'ts. +If you use a browser to simulate a user session and generate its recording, consider the following dos and don'ts. It's a good idea to: - Browse as a user would. - Take natural pauses that users would take to consume page content. - Focus on the most common use cases, rather than all the possible use cases. -- Take note of pages where forms/logins occur. You will likely need to complete some scripting. +- Take note of pages where forms/logins occur. You will need to edit the script to [handle correlation](/examples/correlation-and-dynamic-data/). You probably _do not_ want to: - Visit every page in one journey. - Click every possible option. - Navigate as fast as you can. - Navigate out of your actual site or application. + +## Consider hybrid approach for load testing websites + +When you start the recording and navigate as a user, the recorder captures every HTTP(s) request loaded into the browser as you click. This includes all the requests for third-party services, ads, images, documents, etc. + +When you finish the recording, the converter generates the k6 script from all the recorded requests and assets. +The script could include **dozens or hundreds of requests for each page visit or interaction**. + +These types of recorded tests are difficult to maintain. As the website changes, these tests must be updated to reflect assets and API changes. + +An alternative approach to load test websites is to run a [hybrid load test](https://k6.io/docs/testing-guides/load-testing-websites/#hybrid-load-testing) which: +- Runs a [browser test](/using-k6-browser/running-browser-tests/) to validate the frontend. +- While simultaneously running API tests to inject load to the backend. + +As the browser test automatically handles website assets, these tests require fewer updates. + +To learn more about this approach, check out the [example mixing browser-level and protocol-level tests](/using-k6-browser/running-browser-tests/#run-both-browser-level-and-protocol-level-tests-in-a-single-script). + diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md index e780bda7b7..24dd049427 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md @@ -3,25 +3,26 @@ title: 'Using the browser recorder' excerpt: 'The browser recorder allows generating a k6 script based on a web session. It is available as extensions for Chrome and Firefox.' --- -The browser recorder lets you generate a k6 script based on a web session. +The browser recorder lets you generate a k6 script based on a browser session. It's available as an extension for [Chrome](https://chrome.google.com/webstore/detail/k6-browser-recorder/phjdhndljphphehjpgbmpocddnnmdbda?hl=en) and [Firefox](https://addons.mozilla.org/en-US/firefox/addon/k6-browser-recorder/). -## k6 Cloud integration -The browser recorder integrates with [k6 Cloud](/cloud). -When you finish recording the session, the extension uploads the auto-generated k6 test into the k6 Cloud account. +## Before you start -> **Note**: **the recorder is free to use**. -> ->You do not need an active k6 Cloud subscription. -> -> Any user can copy the script from the [script editor](/cloud/creating-and-running-a-test/script-editor) to edit or run the test locally using the `k6 run` command. We also plan to make this feature work without a k6 Cloud account. +Before you start, consider the following: + +- [Be sure to record realistically](/test-authoring/create-tests-from-recordings/#be-sure-to-record-realistically) +- [A hybrid approach for load testing websites](/test-authoring/create-tests-from-recordings/#consider-hybrid-approach-for-load-testing-websites) -The recorder captures every HTTP(s) request loaded into the browser as you click. -This includes including ads, images, documents, etc. ## How to record +> **Note: the recorder is free to use.** +> +> The browser recorder requires having a [k6 Cloud account](https://app.k6.io), 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. + 1. Install the [Chrome](https://chrome.google.com/webstore/detail/k6-browser-recorder/phjdhndljphphehjpgbmpocddnnmdbda?hl=en) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/k6-browser-recorder/) extension. 1. Open the extension by clicking the k6 logo. 1. Select **Start recording** to begin recording the current browser tab. diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/02 Using the HAR converter.md b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/02 Using the HAR converter.md index c708c04fd3..d75c7192b2 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/02 Using the HAR converter.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/02 Using the HAR converter.md @@ -3,26 +3,19 @@ title: 'Using the HAR converter' excerpt: 'The HAR converter is an alternative to the Browser recorder. It generates a k6 script based on the HTTP requests included on a HAR file.' --- -The HAR converter is an alternative to the [Browser recorder](/test-authoring/recording-a-session/browser-recorder). -It generates a k6 script based on the HTTP requests included in a [HAR file](). +The [har-to-k6 converter](https://github.com/k6io/har-to-k6) is a NodeJS tool that generates a k6 script based on the HTTP requests included in a [HAR file](). +It is an alternative to the [Browser recorder](/test-authoring/recording-a-session/browser-recorder). > HAR is a file format used by all major browsers and various other tools to export recorded HTTP requests. -The [har-to-k6 converter](https://github.com/k6io/har-to-k6) is a NodeJS tool. -Unlike the Browser Recorder, it _does not_ require a k6 Cloud user to generate the k6 script. - -Turning a HAR file into a test follows this sequence: - -1. Record a HAR file. You can use your browser or your tool of choice. -1. Use the `har-to-k6` converter to generate a k6 test from the HAR file. -1. Update the auto-generated k6 test in your text editor or IDE. -1. Use k6 to run the test. - ## Before you start -Before you record your HAR file, you'll need to choose your tool. -You'll also want to consider how you'll record a plausible user session. +Before you start, consider the following: + +- [Be sure to record realistically](/test-authoring/create-tests-from-recordings/#be-sure-to-record-realistically) +- [A hybrid approach for load testing websites](/test-authoring/create-tests-from-recordings/#consider-hybrid-approach-for-load-testing-websites) +You'll need to choose a tool to record your HAR file. Multiple browsers and tools can export HTTP traffic in a HAR format. A few popular ones are: @@ -163,8 +156,3 @@ $ k6 run loadtest.js ``` To learn about running k6, check out the [Running k6 tutorial](/get-started/running-k6). - -## Read more - -- [Browser recorder](/test-authoring/recording-a-session/browser-recorder): Chrome and Firefox extensions to generate a k6 script from a browser session. - From 5d9e09412588101240fffbf72ab6ef9b6cf586a1 Mon Sep 17 00:00:00 2001 From: Pepe Cano <825430+ppcano@users.noreply.github.com> Date: Wed, 17 May 2023 17:33:55 +0200 Subject: [PATCH 5/7] Update internal links --- .../01 Creating and running a test/01 Test authoring.md | 2 +- .../01 Test authoring/02 browser-recorder.md | 2 +- .../01 Examples/04 correlation-and-dynamic-data.md | 2 +- .../translated-guides/en/01 Get started/05 resources.md | 2 +- .../en/05 Test authoring/01 test builder.md | 2 +- .../en/05 Test authoring/02 Create tests from recordings.md | 4 ++-- .../01 Using the browser recorder.md | 4 ++-- .../02 Using the HAR converter.md | 2 +- .../markdown/translated-guides/en/07 Misc/09 Glossary.md | 2 +- .../en/08 Testing Guides/03 Load testing websites.md | 6 +++--- .../translated-guides/es/01 Get started/05 resources.md | 2 +- .../es/06 Testing Guides/03 Load testing websites.md | 6 +++--- src/templates/docs/cloud.js | 2 +- src/templates/docs/integrations.js | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/data/markdown/docs/03 cloud/01 Creating and running a test/01 Test authoring.md b/src/data/markdown/docs/03 cloud/01 Creating and running a test/01 Test authoring.md index 8b7c808fe5..36caf4662e 100644 --- a/src/data/markdown/docs/03 cloud/01 Creating and running a test/01 Test authoring.md +++ b/src/data/markdown/docs/03 cloud/01 Creating and running a test/01 Test authoring.md @@ -13,7 +13,7 @@ Besides writing a test in your text editor or IDE, you can also use a k6-support - The [Test builder](/test-authoring/test-builder) is a graphical test builder. - The [Script editor](/cloud/creating-and-running-a-test/script-editor) is a web-based editor in k6 cloud. -- [Browser recorders](/test-authoring/recording-a-session/browser-recorder) create scripts from recorded sessions. +- [Browser recorders](/test-authoring/create-tests-from-recordings/using-the-browser-recorder/) create scripts from recorded sessions. - [Converters](/integrations#converters) create tests from HAR, Postman, and OpenAPI files ## Running a cloud test diff --git a/src/data/markdown/docs/04 integrations/01 Test authoring/02 browser-recorder.md b/src/data/markdown/docs/04 integrations/01 Test authoring/02 browser-recorder.md index 4f54b5dc90..b5eeca052b 100644 --- a/src/data/markdown/docs/04 integrations/01 Test authoring/02 browser-recorder.md +++ b/src/data/markdown/docs/04 integrations/01 Test authoring/02 browser-recorder.md @@ -1,4 +1,4 @@ --- title: 'Browser Recorder' -redirect: 'https://k6.io/docs/test-authoring/recording-a-session/browser-recorder' +redirect: 'https://k6.io/docs/test-authoring/create-tests-from-recordings/using-the-browser-recorder/' --- diff --git a/src/data/markdown/docs/05 Examples/01 Examples/04 correlation-and-dynamic-data.md b/src/data/markdown/docs/05 Examples/01 Examples/04 correlation-and-dynamic-data.md index 1ca4a2f211..fabaa9e0e5 100644 --- a/src/data/markdown/docs/05 Examples/01 Examples/04 correlation-and-dynamic-data.md +++ b/src/data/markdown/docs/05 Examples/01 Examples/04 correlation-and-dynamic-data.md @@ -20,7 +20,7 @@ In a load testing scenario, correlation means extracting one or more values from of one request and then reusing them in subsequent requests. Often, this could be getting a token or some sort of ID necessary to fulfill a sequence of steps in a user journey. -The [browser recording](/test-authoring/recording-a-session/) will capture session data such as CSRF tokens, +A [recording](/test-authoring/create-tests-from-recordings/) will capture session data such as CSRF tokens, VIEWSTATES, nonce, etc. This type of data is unlikely to be valid when you run your test, meaning you'll need to handle the extraction of this data from the HTML/form to include it in subsequent requests. This issue is fairly common with any site that has forms diff --git a/src/data/markdown/translated-guides/en/01 Get started/05 resources.md b/src/data/markdown/translated-guides/en/01 Get started/05 resources.md index e8f2ab0267..053d69b5b2 100644 --- a/src/data/markdown/translated-guides/en/01 Get started/05 resources.md +++ b/src/data/markdown/translated-guides/en/01 Get started/05 resources.md @@ -34,7 +34,7 @@ If you need a place to test k6 scripts, you can load these servers as much as yo - [Kubernetes Operator](https://k6.io/blog/running-distributed-tests-on-k8s/). Distribute test execution across a Kubernetes cluster. - [xk6 extensions](/extensions). Custom k6 binaries to support the tool you need. -- [The browser recorder](/test-authoring/recording-a-session/browser-recorder/). Make test scripts from browser sessions. +- [The browser recorder](/test-authoring/create-tests-from-recordings/using-the-browser-recorder/). Make test scripts from browser sessions. - [k6 TypeScript template](https://github.com/grafana/k6-template-typescript) - [Integrations](/integrations/) diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/01 test builder.md b/src/data/markdown/translated-guides/en/05 Test authoring/01 test builder.md index cf696c14ff..c6e31b18ca 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/01 test builder.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/01 test builder.md @@ -108,7 +108,7 @@ Check out the script to get familiar with the [k6 API](/javascript-api/) or to c - Add a [check](/javascript-api/k6/check) on a request response. - Add [sleep](/javascript-api/k6/sleep) time between requests. - Add a [group](/javascript-api/k6/group) to the test. -- Import recorded requests using the [browser recorder](/test-authoring/recording-a-session/browser-recorder). +- Import recorded requests using the [browser recorder](/test-authoring/create-tests-from-recordings/using-the-browser-recorder/). - Import requests included in a [HAR file](). - Capture a variable when dealing with dynamic data, such as authentication tokens. - Show relevant examples. diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md index 980836716e..33bbef3e87 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md @@ -11,8 +11,8 @@ For example, testing advanced scenarios on websites or mobile applications, such k6 provides two tools that can directly convert a recording into k6 script: -- [Browser recorder](/test-authoring/recording-a-session/browser-recorder) generates a k6 script from a browser session. -- [HAR converter](/test-authoring/recording-a-session/har-converter) generates a k6 script from the requests included in a HAR file. +- [Browser recorder](/test-authoring/create-tests-from-recordings/using-the-browser-recorder/) generates a k6 script from a browser session. +- [HAR converter](/test-authoring/create-tests-from-recordings/using-the-har-converter/) generates a k6 script from the requests included in a HAR file. ## Steps diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md index 24dd049427..3c838c2f6a 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md @@ -32,7 +32,7 @@ Before you start, consider the following: 1. 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. ![Step 4](./images/Recording-a-test-script/step-4.png) -1. Edit your script as necessary. Depending on the type of testing, you might need to change different aspects of the script. +1. Edit your script as necessary. Depending on the [type of load test](/test-types/load-test-types/), you might need to change different aspects of the script. Typical changes are for [load options](/using-k6/options) and to handle [correlation and dynamic data](/examples/correlation-and-dynamic-data). 1. Run the test locally or in k6 Cloud. @@ -44,7 +44,7 @@ For more about running k6, refer to the [Running k6 guide](/get-started/running- ## 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](/test-authoring/recording-a-session/har-converter/), which creates a k6 script from the HTTP requests included in a HAR file (it also powers the browser recorder). +In these cases, the easiest fix is to use the [HAR converter](/test-authoring/create-tests-from-recordings/using-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. diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/02 Using the HAR converter.md b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/02 Using the HAR converter.md index d75c7192b2..eabc1593a8 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/02 Using the HAR converter.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/02 Using the HAR converter.md @@ -4,7 +4,7 @@ excerpt: 'The HAR converter is an alternative to the Browser recorder. It genera --- The [har-to-k6 converter](https://github.com/k6io/har-to-k6) is a NodeJS tool that generates a k6 script based on the HTTP requests included in a [HAR file](). -It is an alternative to the [Browser recorder](/test-authoring/recording-a-session/browser-recorder). +It is an alternative to the [Browser recorder](/test-authoring/create-tests-from-recordings/using-the-browser-recorder/). > HAR is a file format used by all major browsers and various other tools to export recorded HTTP requests. diff --git a/src/data/markdown/translated-guides/en/07 Misc/09 Glossary.md b/src/data/markdown/translated-guides/en/07 Misc/09 Glossary.md index ca09bf4c34..74e1e9e02d 100644 --- a/src/data/markdown/translated-guides/en/07 Misc/09 Glossary.md +++ b/src/data/markdown/translated-guides/en/07 Misc/09 Glossary.md @@ -82,7 +82,7 @@ Happy path : The default system behavior that happens when a known input produces an expected output. A common mistake in performance testing happens when scripts account only for the best case (in other words, the happy path). Most load tests try to discover system errors, so test scripts should include exception handling.

[Happy path (Wikipedia)](https://en.wikipedia.org/wiki/Happy_path) HTTP archive -: *(Or HAR file)*. A file containing logs of browser interactions with the system under test. All included transactions are stored as JSON-formatted text. You can use these archives to generate test scripts (for example, with the har-to-k6 Converter).

[HAR 1.2 Specification](http://www.softwareishard.com/blog/har-12-spec/), [HAR converter](/test-authoring/recording-a-session/har-converter/) +: *(Or HAR file)*. A file containing logs of browser interactions with the system under test. All included transactions are stored as JSON-formatted text. You can use these archives to generate test scripts (for example, with the har-to-k6 Converter).

[HAR 1.2 Specification](http://www.softwareishard.com/blog/har-12-spec/), [HAR converter](/test-authoring/create-tests-from-recordings/using-the-har-converter/) Iteration : A single run in the execution of the `default function`, or scenario `exec` function. You can set iterations across all VUs, or per VU.

The [test life cycle](/using-k6/test-life-cycle/) document breaks down each stage of a k6 script, including iterations in VU code. diff --git a/src/data/markdown/translated-guides/en/08 Testing Guides/03 Load testing websites.md b/src/data/markdown/translated-guides/en/08 Testing Guides/03 Load testing websites.md index 3af8a03704..11c801468e 100644 --- a/src/data/markdown/translated-guides/en/08 Testing Guides/03 Load testing websites.md +++ b/src/data/markdown/translated-guides/en/08 Testing Guides/03 Load testing websites.md @@ -161,7 +161,7 @@ export function Homepage() { } ``` -[Recording browser traffic](https://k6.io/docs/test-authoring/recording-a-session/browser-recorder/) helps you prototype to test websites on the protocol level. +[Recording browser traffic](https://k6.io/docs/test-authoring/create-tests-from-recordings/using-the-browser-recorder/) helps you prototype to test websites on the protocol level. ### Browser-based load testing @@ -249,7 +249,7 @@ When you script a test for a website, consider these recommendations. ### Consider factors that affect script realism -**Record your user journey.** Using the browser recorder can facilitate initial test script creation by capturing all the embedded resources on webpages. Check out the [Session Recording guide](https://k6.io/docs/test-authoring/recording-a-session) to learn more about how to auto-generate your load test from a user session. +**Record your user journey.** Using the browser recorder can facilitate initial test script creation by capturing all the embedded resources on webpages. Check out the [Session Recording guide](https://k6.io/docs/test-authoring/create-tests-from-recordings/) to learn more about how to auto-generate your load test from a user session. **Correlate data.** Recordings often don't take into account dynamic values that are generated anew each time a request is made. Go through the recorded requests and determine whether you need to [extract values from previous responses](https://k6.io/docs/examples/correlation-and-dynamic-data/) and use parameters in subsequent requests. This practice ensures your VUs behave more like real users would. @@ -334,6 +334,6 @@ Load testing websites can be complex due to the number of viable testing approac - [Browser testing with k6 browser](https://k6.io/docs/using-k6-browser/overview/) - [Load test types](https://k6.io/docs/test-types/load-test-types) -- [Session recording guide](https://k6.io/docs/test-authoring/recording-a-session) +- [Session recording guide](https://k6.io/docs/test-authoring/create-tests-from-recordings) - [Determining concurrent users in your load tests](https://k6.io/blog/monthly-visits-concurrent-users) - [Data correlation in your test script](https://k6.io/docs/examples/correlation-and-dynamic-data) diff --git a/src/data/markdown/translated-guides/es/01 Get started/05 resources.md b/src/data/markdown/translated-guides/es/01 Get started/05 resources.md index 732aa550ff..4febb73207 100644 --- a/src/data/markdown/translated-guides/es/01 Get started/05 resources.md +++ b/src/data/markdown/translated-guides/es/01 Get started/05 resources.md @@ -28,6 +28,6 @@ Estos recursos te ayudarán a escribir y ejecutar k6 tests en un entorno de test - [Kubernetes Operator](https://k6.io/blog/running-distributed-tests-on-k8s/). Distribuye la ejecución del test de carga a través de un cluster de Kubernetes. - [xk6 extensions](/extensions). Extiende k6 con nuevas funcionalidades. -- [The browser recorder](/test-authoring/recording-a-session/browser-recorder/). Create un test desde una sesión en el navegador. +- [The browser recorder](/test-authoring/create-tests-from-recordings/using-the-browser-recorder/). Create un test desde una sesión en el navegador. - [k6 TypeScript template](https://github.com/grafana/k6-template-typescript). - [Integrations](/integrations/). diff --git a/src/data/markdown/translated-guides/es/06 Testing Guides/03 Load testing websites.md b/src/data/markdown/translated-guides/es/06 Testing Guides/03 Load testing websites.md index a5a7a9acf6..2d6e8abad1 100644 --- a/src/data/markdown/translated-guides/es/06 Testing Guides/03 Load testing websites.md +++ b/src/data/markdown/translated-guides/es/06 Testing Guides/03 Load testing websites.md @@ -166,7 +166,7 @@ export function Homepage() { } ``` -[Registrar el tráfico del navegador](https://k6.io/docs/test-authoring/recording-a-session/browser-recorder/) le ayuda a crear prototipos para probar sitios web a nivel de protocolos. +[Registrar el tráfico del navegador](https://k6.io/docs//test-authoring/create-tests-from-recordings/using-the-browser-recorder/) le ayuda a crear prototipos para probar sitios web a nivel de protocolos. ### Pruebas de carga basadas en el navegador @@ -250,7 +250,7 @@ Cuando escriba un script de prueba para un sitio web, considere estas recomendac ### Considere los factores que afectan al realismo del script -**Grabe su recorrido de usuario.** Usar la grabadora del navegador puede servir de ayuda para empezar a crear el script de prueba al capturar todos los recursos insertados en las páginas web. Consulte [Session Recording guide](https://k6.io/docs/test-authoring/recording-a-session) para obtener más información sobre cómo generar automáticamente su prueba de carga a partir de una sesión de usuario. +**Grabe su recorrido de usuario.** Usar la grabadora del navegador puede servir de ayuda para empezar a crear el script de prueba al capturar todos los recursos insertados en las páginas web. Consulte [Session Recording guide](https://k6.io/docs/test-authoring/create-tests-from-recordings) para obtener más información sobre cómo generar automáticamente su prueba de carga a partir de una sesión de usuario. **Correlacione los datos.** Las grabaciones a menudo no tienen en cuenta los valores dinámicos que se generan de nuevo cada vez que se realiza una solicitud. Revise las solicitudes grabadas y determine si necesita [extraer valores de respuestas anteriores](https://k6.io/docs/examples/correlation-and-dynamic-data/) y usar parámetros en solicitudes posteriores. Esta práctica garantiza que sus usuarios virtuales se comporten de una forma más parecida a como lo harían los usuarios reales. @@ -339,6 +339,6 @@ Las pruebas de carga de los sitios web pueden ser complejas debido a la cantidad - [Browser testing with xk6-browser](https://k6.io/docs/javascript-api/xk6-browser/) - [Test types](https://k6.io/docs/test-types/introduction) -- [Session recording guide](https://k6.io/docs/test-authoring/recording-a-session) +- [Session recording guide](https://k6.io/docs/test-authoring/create-tests-from-recordings/) - [Determining concurrent users in your load tests](https://k6.io/blog/monthly-visits-concurrent-users) - [Data correlation in your test script](https://k6.io/docs/examples/correlation-and-dynamic-data) diff --git a/src/templates/docs/cloud.js b/src/templates/docs/cloud.js index a86286dd96..77f97fb5ef 100644 --- a/src/templates/docs/cloud.js +++ b/src/templates/docs/cloud.js @@ -139,7 +139,7 @@ const Cloud = ({ pageContext: { sidebarTree, navLinks } }) => { and{' '} Browser Recorder diff --git a/src/templates/docs/integrations.js b/src/templates/docs/integrations.js index 235a2d8635..413679b65f 100644 --- a/src/templates/docs/integrations.js +++ b/src/templates/docs/integrations.js @@ -418,7 +418,7 @@ const Integrations = ({ pageContext: { sidebarTree, navLinks } }) => { image: browserRecorderImg, title: 'Browser Recorder', description: 'Record a user journey to base your k6 test.', - url: 'https://k6.io/docs/test-authoring/recording-a-session/browser-recorder/', + url: 'https://k6.io/docs/test-authoring/create-tests-from-recordings/using-the-browser-recorder/', }, ]} /> From ffe51469bad33284b1ed1314b71f4da5691579fe Mon Sep 17 00:00:00 2001 From: Pepe Cano <825430+ppcano@users.noreply.github.com> Date: Thu, 18 May 2023 12:13:31 +0200 Subject: [PATCH 6/7] Update src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md Co-authored-by: Matt Dodson <47385188+MattDodsonEnglish@users.noreply.github.com> --- .../en/05 Test authoring/02 Create tests from recordings.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md index 33bbef3e87..2d27dc7ba1 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings.md @@ -3,8 +3,8 @@ title: 'Create tests from recordings' excerpt: 'In load testing, recording usually refers to the process of creating a load test from the recording of a user session.' --- -A recording stores the sequence of requests and parameters of a user session or API interactions. -You can then use this recording to auto-generate the logic of your test. +A recording stores the sequence of requests and parameters of a user session or API interaction. +You can use this recording to auto-generate your test logic. Testers commonly use recordings to avoid writing complex tests from scratch. For example, testing advanced scenarios on websites or mobile applications, such as end-to-end (E2E) tests with dozens or hundreds of requests. From 8105fb47efe414769ee90c137e87f734c60a4318 Mon Sep 17 00:00:00 2001 From: Pepe Cano <825430+ppcano@users.noreply.github.com> Date: Thu, 18 May 2023 12:13:40 +0200 Subject: [PATCH 7/7] Update src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md Co-authored-by: Matt Dodson <47385188+MattDodsonEnglish@users.noreply.github.com> --- .../01 Using the browser recorder.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md index 3c838c2f6a..5e18813666 100644 --- a/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md +++ b/src/data/markdown/translated-guides/en/05 Test authoring/02 Create tests from recordings/01 Using the browser recorder.md @@ -17,11 +17,13 @@ Before you start, consider the following: ## How to record -> **Note: the recorder is free to use.** -> -> The browser recorder requires having a [k6 Cloud account](https://app.k6.io), 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. +
+ +The browser recorder requires a [k6 Cloud account](https://app.k6.io), 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. + +
1. Install the [Chrome](https://chrome.google.com/webstore/detail/k6-browser-recorder/phjdhndljphphehjpgbmpocddnnmdbda?hl=en) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/k6-browser-recorder/) extension. 1. Open the extension by clicking the k6 logo.