Skip to content

Commit 4c48de4

Browse files
authored
Merge pull request #1661 from grafana/docs/k6-devtools-recorder
Add documentation for the k6 DevTools Recorder
2 parents 73ee260 + a7fabd4 commit 4c48de4

File tree

4 files changed

+66
-2
lines changed

4 files changed

+66
-2
lines changed

docs/sources/next/using-k6/test-authoring/create-tests-from-recordings/_index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ You can use this recording to auto-generate your test logic.
1212
Testers commonly use recordings to avoid writing complex tests from scratch.
1313
For example, testing advanced scenarios on websites or mobile applications, such as end-to-end (E2E) tests with dozens or hundreds of requests.
1414

15-
k6 provides two tools that can directly convert a recording into k6 script:
15+
k6 provides three tools that can directly convert a recording into k6 script:
1616

1717
- [Browser recorder](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/test-authoring/create-tests-from-recordings/using-the-browser-recorder) generates a k6 script from a browser session.
18+
- [DevTools recorder](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/test-authoring/create-tests-from-recordings/using-the-devtools-recorder) generates a k6 Browser script from user flows recorded in Chrome DevTools.
1819
- [HAR converter](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/test-authoring/create-tests-from-recordings/using-the-har-converter) generates a k6 script from the requests included in a HAR file.
1920

2021
## Steps
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: 'Using the k6 DevTools recorder'
3+
description: 'The k6 DevTools recorder allows you to export k6 browser scripts from the recorder panel in Chrome DevTools.'
4+
weight: 01
5+
---
6+
7+
# Using the k6 DevTools recorder
8+
9+
The k6 DevTools recorder lets you record user journeys using Chrome DevTools and then export them as a k6 script.
10+
11+
## Before you begin
12+
13+
To ensure you have a useful test output:
14+
15+
- Review the [Be sure to record realistically](/test-authoring/create-tests-from-recordings/#be-sure-to-record-realistically) and [Consider hybrid approach for load testing websites](/test-authoring/create-tests-from-recordings/#consider-hybrid-approach-for-load-testing-websites) sections on [Create tests from recordings](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/test-authoring/create-tests-from-recordings/).
16+
- Learn the basics of k6 browser tests with [Running browser tests](https://grafana.com/docs/k6/<K6_VERSION>/using-k6-browser/running-browser-tests/).
17+
18+
{{< admonition type="note" >}}
19+
20+
Using the DevTools recorder _doesn't require a Grafana Cloud account_.
21+
22+
{{< /admonition >}}
23+
24+
## Create a script from a recording
25+
26+
1. Install the [k6 Browser Recorder Chrome extension](https://chromewebstore.google.com/detail/k6-devtools-recorder/fkajbajcclbdgaoanencnhpfnigfipgc).
27+
1. Record a session using the [Chrome DevTools Recorder](https://developer.chrome.com/docs/devtools/recorder).
28+
1. [Export the user flow](https://developer.chrome.com/docs/devtools/recorder/reference#export-flows) and choose the k6 Browser option.
29+
1. Edit your script as necessary. Depending on the [type of test](https://grafana.com/docs/k6/<K6_VERSION>/testing-guides/test-types/), you might need to change different aspects of the script.
30+
Typical changes are for [load options](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options) and to handle [correlation and dynamic data](https://grafana.com/docs/k6/<K6_VERSION>/examples/correlation-and-dynamic-data).
31+
1. Run the test from the CLI or Grafana Cloud k6. Refer to [Running k6](https://grafana.com/docs/k6/<K6_VERSION>/get-started/running-k6) for more details.

docs/sources/v0.52.x/using-k6/test-authoring/create-tests-from-recordings/_index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ You can use this recording to auto-generate your test logic.
1212
Testers commonly use recordings to avoid writing complex tests from scratch.
1313
For example, testing advanced scenarios on websites or mobile applications, such as end-to-end (E2E) tests with dozens or hundreds of requests.
1414

15-
k6 provides two tools that can directly convert a recording into k6 script:
15+
k6 provides three tools that can directly convert a recording into k6 script:
1616

1717
- [Browser recorder](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/test-authoring/create-tests-from-recordings/using-the-browser-recorder) generates a k6 script from a browser session.
18+
- [DevTools recorder](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/test-authoring/create-tests-from-recordings/using-the-devtools-recorder) generates a k6 Browser script from user flows recorded in Chrome DevTools.
1819
- [HAR converter](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/test-authoring/create-tests-from-recordings/using-the-har-converter) generates a k6 script from the requests included in a HAR file.
1920

2021
## Steps
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: 'Using the k6 DevTools recorder'
3+
description: 'The k6 DevTools recorder allows you to export k6 browser scripts from the recorder panel in Chrome DevTools.'
4+
weight: 01
5+
---
6+
7+
# Using the k6 DevTools recorder
8+
9+
The k6 DevTools recorder lets you record user journeys using Chrome DevTools and then export them as a k6 script.
10+
11+
## Before you begin
12+
13+
To ensure you have a useful test output:
14+
15+
- Review the [Be sure to record realistically](/test-authoring/create-tests-from-recordings/#be-sure-to-record-realistically) and [Consider hybrid approach for load testing websites](/test-authoring/create-tests-from-recordings/#consider-hybrid-approach-for-load-testing-websites) sections on [Create tests from recordings](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/test-authoring/create-tests-from-recordings/).
16+
- Learn the basics of k6 browser tests with [Running browser tests](https://grafana.com/docs/k6/<K6_VERSION>/using-k6-browser/running-browser-tests/).
17+
18+
{{< admonition type="note" >}}
19+
20+
Using the DevTools recorder _doesn't require a Grafana Cloud account_.
21+
22+
{{< /admonition >}}
23+
24+
## Create a script from a recording
25+
26+
1. Install the [k6 Browser Recorder Chrome extension](https://chromewebstore.google.com/detail/k6-devtools-recorder/fkajbajcclbdgaoanencnhpfnigfipgc).
27+
1. Record a session using the [Chrome DevTools Recorder](https://developer.chrome.com/docs/devtools/recorder).
28+
1. [Export the user flow](https://developer.chrome.com/docs/devtools/recorder/reference#export-flows) and choose the k6 Browser option.
29+
1. Edit your script as necessary. Depending on the [type of test](https://grafana.com/docs/k6/<K6_VERSION>/testing-guides/test-types/), you might need to change different aspects of the script.
30+
Typical changes are for [load options](https://grafana.com/docs/k6/<K6_VERSION>/using-k6/k6-options) and to handle [correlation and dynamic data](https://grafana.com/docs/k6/<K6_VERSION>/examples/correlation-and-dynamic-data).
31+
1. Run the test from the CLI or Grafana Cloud k6. Refer to [Running k6](https://grafana.com/docs/k6/<K6_VERSION>/get-started/running-k6) for more details.

0 commit comments

Comments
 (0)