Skip to content

Commit 7d38fd9

Browse files
committed
Use mainframe in frame.locator
1 parent 234734c commit 7d38fd9

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export default async function () {
4949

5050
await page.goto('https://quickpizza.grafana.com');
5151

52-
// Get frame
53-
const frame = page.frames()[1];
52+
// Get the mainframe of the page
53+
const frame = page.mainFrame();
5454

5555
// Create a locator with text filtering options
5656
const submitButton = frame.locator('button', { hasText: 'Pizza, Please!' });

0 commit comments

Comments
 (0)