Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for the k6 DevTools Recorder #1661

Merged
merged 18 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3ad9be9
add sections on using the k6 devtools recorder
allansson Jul 22, 2024
d10e033
copy-paste error
allansson Jul 22, 2024
2f4a1a8
retro-actively add docs for two versions back
allansson Jul 22, 2024
efec5d4
Update docs/sources/next/using-k6/test-authoring/create-tests-from-re…
allansson Jul 23, 2024
9ede4b0
Update docs/sources/next/using-k6/test-authoring/create-tests-from-re…
allansson Jul 23, 2024
9d0f94a
Update docs/sources/next/using-k6/test-authoring/create-tests-from-re…
allansson Jul 23, 2024
dc98b40
Update docs/sources/next/using-k6/test-authoring/create-tests-from-re…
allansson Jul 23, 2024
ecb6a55
Update docs/sources/next/using-k6/test-authoring/create-tests-from-re…
allansson Jul 23, 2024
777b9a0
Update docs/sources/next/using-k6/test-authoring/create-tests-from-re…
allansson Jul 23, 2024
ac8f929
Update docs/sources/next/using-k6/test-authoring/create-tests-from-re…
allansson Jul 23, 2024
ae8174c
add reference to running browser tests
allansson Jul 23, 2024
59c8719
Update docs/sources/next/using-k6/test-authoring/create-tests-from-re…
allansson Jul 26, 2024
29702ec
Update docs/sources/next/using-k6/test-authoring/create-tests-from-re…
allansson Jul 26, 2024
f7c6ee4
Update docs/sources/next/using-k6/test-authoring/create-tests-from-re…
allansson Jul 26, 2024
3fa5aef
update copy for devtools recorder in 0.52.x
allansson Jul 26, 2024
e8bdb31
revert changes for devtools recorder in 0.51.x
allansson Jul 26, 2024
cf367cf
update url to recorder extension store page
allansson Jul 26, 2024
a7fabd4
Merge branch 'main' into docs/k6-devtools-recorder
allansson Jul 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ 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.

k6 provides two tools that can directly convert a recording into k6 script:
k6 provides three tools that can directly convert a recording into k6 script:

- [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.
- [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.
- [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.

## Steps
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: 'Using the DevTools recorder'
description: 'The DevTools recorder allows exporting k6 browser scripts from the recorder panel in Chrome DevTools.'
allansson marked this conversation as resolved.
Show resolved Hide resolved
weight: 01
---

The DevTools recorder lets you record user journeys using Chrome DevTools and then export them as a k6 script.
allansson marked this conversation as resolved.
Show resolved Hide resolved

## Before you start

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)
allansson marked this conversation as resolved.
Show resolved Hide resolved

{{< admonition type="note" >}}

Note that the DevTools recorder **does not require a cloud account**.
allansson marked this conversation as resolved.
Show resolved Hide resolved

{{< /admonition >}}

## How to record
allansson marked this conversation as resolved.
Show resolved Hide resolved

1. Install the [Chrome](https://chrome.google.com/webstore/detail/grafana-k6-browser-record/fbanjfonbcedhifbgikmjelkkckhhidl) extension.
allansson marked this conversation as resolved.
Show resolved Hide resolved
1. Record a session using the [Chrome DevTools Recorder](https://developer.chrome.com/docs/devtools/recorder).
1. Choose k6 Browser when [exporting the user flow](https://developer.chrome.com/docs/devtools/recorder/reference#export-flows).
allansson marked this conversation as resolved.
Show resolved Hide resolved
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.
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).
1. Run the test from the CLI or Grafana Cloud k6. For more about running k6, refer to the [Running k6 guide](https://grafana.com/docs/k6/<K6_VERSION>/get-started/running-k6).
allansson marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ 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.

k6 provides two tools that can directly convert a recording into k6 script:
k6 provides three tools that can directly convert a recording into k6 script:

- [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.
- [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.
- [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.

## Steps
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: 'Using the DevTools recorder'
description: 'The DevTools recorder allows exporting k6 browser scripts from the recorder panel in Chrome DevTools.'
weight: 01
---

The DevTools recorder lets you record user journeys using Chrome DevTools and then export them as a k6 script.

## Before you start

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)

{{< admonition type="note" >}}

Note that the DevTools recorder **does not require a cloud account**.

{{< /admonition >}}

## How to record

1. Install the [Chrome](https://chrome.google.com/webstore/detail/grafana-k6-browser-record/fbanjfonbcedhifbgikmjelkkckhhidl) extension.
1. Record a session using the [Chrome DevTools Recorder](https://developer.chrome.com/docs/devtools/recorder).
1. Choose k6 Browser when [exporting the user flow](https://developer.chrome.com/docs/devtools/recorder/reference#export-flows).
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.
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).
1. Run the test from the CLI or Grafana Cloud k6. For more about running k6, refer to the [Running k6 guide](https://grafana.com/docs/k6/<K6_VERSION>/get-started/running-k6).
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ 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.

k6 provides two tools that can directly convert a recording into k6 script:
k6 provides three tools that can directly convert a recording into k6 script:

- [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.
- [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.
- [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.

## Steps
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: 'Using the DevTools recorder'
description: 'The DevTools recorder allows exporting k6 browser scripts from the recorder panel in Chrome DevTools.'
weight: 01
---

The DevTools recorder lets you record user journeys using Chrome DevTools and then export them as a k6 script.

## Before you start

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)

{{< admonition type="note" >}}

Note that the DevTools recorder **does not require a cloud account**.

{{< /admonition >}}

## How to record

1. Install the [Chrome](https://chrome.google.com/webstore/detail/grafana-k6-browser-record/fbanjfonbcedhifbgikmjelkkckhhidl) extension.
1. Record a session using the [Chrome DevTools Recorder](https://developer.chrome.com/docs/devtools/recorder).
1. Choose k6 Browser when [exporting the user flow](https://developer.chrome.com/docs/devtools/recorder/reference#export-flows).
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.
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).
1. Run the test from the CLI or Grafana Cloud k6. For more about running k6, refer to the [Running k6 guide](https://grafana.com/docs/k6/<K6_VERSION>/get-started/running-k6).
Loading