diff --git a/docs/sources/next/javascript-api/k6-browser/elementhandle/_index.md b/docs/sources/next/javascript-api/k6-browser/elementhandle/_index.md index c05dc0fde4..db33498564 100644 --- a/docs/sources/next/javascript-api/k6-browser/elementhandle/_index.md +++ b/docs/sources/next/javascript-api/k6-browser/elementhandle/_index.md @@ -38,7 +38,7 @@ weight: 04 | [scrollIntoViewIfNeeded([options])](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/scrollintoviewifneeded) | Scrolls the element into view if needed. | | [selectOption(values[, options])](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/selectoption) | Selects the `select` element's one or more options which match the values. | | [selectText([options])](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/selecttext) | Selects the text of the element. | -| [setChecked(checked[, options])](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/setchecked) | Sets the `checkbox` or `radio` input element's value to the specified checked or unchecked state. | +| setChecked(checked[, options]) | Sets the `checkbox` or `radio` input element's value to the specified checked or unchecked state. | | [setInputFiles(file[, options])](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/setinputfiles) | Sets the file input element's value to the specified files. | | [tap(options)](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/tap) | Taps the element. | | [textContent()](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/textcontent) | Returns the text content of the element. | @@ -49,8 +49,6 @@ weight: 04 ## Examples -{{< code >}} - ```javascript import { check } from 'k6'; import { browser } from 'k6/browser'; @@ -84,7 +82,7 @@ export default async function () { const submitButton = await page.$('input[type="submit"]'); await Promise.all([page.waitForNavigation(), submitButton.click()]); - const text = await p.$('h2'); + const text = await page.$('h2'); const content = await text.textContent(); check(page, { header: () => text == 'Welcome, admin!', @@ -95,9 +93,7 @@ export default async function () { } ``` -{{< /code >}} - -{{< code >}} + ```javascript import { browser } from 'k6/browser'; @@ -167,5 +163,3 @@ export default function () { } } ``` - -{{< /code >}} diff --git a/docs/sources/v0.52.x/javascript-api/k6-browser/elementhandle/_index.md b/docs/sources/v0.52.x/javascript-api/k6-browser/elementhandle/_index.md index c05dc0fde4..f546e0c974 100644 --- a/docs/sources/v0.52.x/javascript-api/k6-browser/elementhandle/_index.md +++ b/docs/sources/v0.52.x/javascript-api/k6-browser/elementhandle/_index.md @@ -38,7 +38,7 @@ weight: 04 | [scrollIntoViewIfNeeded([options])](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/scrollintoviewifneeded) | Scrolls the element into view if needed. | | [selectOption(values[, options])](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/selectoption) | Selects the `select` element's one or more options which match the values. | | [selectText([options])](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/selecttext) | Selects the text of the element. | -| [setChecked(checked[, options])](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/setchecked) | Sets the `checkbox` or `radio` input element's value to the specified checked or unchecked state. | +| setChecked(checked[, options]) | Sets the `checkbox` or `radio` input element's value to the specified checked or unchecked state. | | [setInputFiles(file[, options])](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/setinputfiles) | Sets the file input element's value to the specified files. | | [tap(options)](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/tap) | Taps the element. | | [textContent()](https://grafana.com/docs/k6//javascript-api/k6-browser/elementhandle/textcontent) | Returns the text content of the element. | @@ -49,8 +49,6 @@ weight: 04 ## Examples -{{< code >}} - ```javascript import { check } from 'k6'; import { browser } from 'k6/browser'; @@ -84,7 +82,7 @@ export default async function () { const submitButton = await page.$('input[type="submit"]'); await Promise.all([page.waitForNavigation(), submitButton.click()]); - const text = await p.$('h2'); + const text = await page.$('h2'); const content = await text.textContent(); check(page, { header: () => text == 'Welcome, admin!', @@ -95,13 +93,11 @@ export default async function () { } ``` -{{< /code >}} - -{{< code >}} + ```javascript -import { browser } from 'k6/browser'; import { check } from 'k6'; +import { browser } from 'k6/browser'; export const options = { scenarios: { @@ -167,5 +163,3 @@ export default function () { } } ``` - -{{< /code >}}