Skip to content

Commit 44cb790

Browse files
committed
Use iframe in framelocator.locator example
1 parent 0a4def2 commit 44cb790

File tree

1 file changed

+2
-2
lines changed
  • docs/sources/k6/next/javascript-api/k6-browser/framelocator

1 file changed

+2
-2
lines changed

docs/sources/k6/next/javascript-api/k6-browser/framelocator/locator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ export const options = {
4747
export default async function () {
4848
const page = await browser.newPage();
4949

50-
await page.goto('https://quickpizza.grafana.com');
50+
await page.setContent(`<iframe src='https://quickpizza.grafana.com'></iframe>`);
5151

5252
// Get a locator for an iframe element
5353
const frameLocator = page.locator('iframe').contentFrame();
5454

5555
// Create a locator within the frame with text filtering options
56-
const submitButton = frameLocator.locator('button', { hasText: 'Submit Order' });
56+
const submitButton = frameLocator.locator('button', { hasText: 'Pizza, Please!' });
5757
await submitButton.click();
5858
}
5959
```

0 commit comments

Comments
 (0)