Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/k6/next/javascript-api/k6-browser/framelocator.md, or by sending Accept: text/markdown to https://grafana.com/docs/k6/next/javascript-api/k6-browser/framelocator/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
FrameLocator
FrameLocator represents a way to find element(s) in an iframe. Frames can be nested, and this locator supports selecting a frame element and then working with it.
A FrameLocator can be created with the page.frameLocator(selector) method or the locator.contentFrame() method.
| Method | Description |
|---|---|
| frameLocator(selector) | Returns a
FrameLocator for a nested iframe matching the given selector within this frame. |
| getByAltText(altText[, options]) | Returns a locator for elements with the specified alt attribute text. |
| getByLabel(text[, options]) | Returns a locator for form controls with the specified label text. |
| getByPlaceholder(placeholder[, options]) | Returns a locator for input elements with the specified placeholder attribute text. |
| getByRole(role[, options]) | Returns a locator for elements with the specified ARIA role. |
| getByTestId(testId) | Returns a locator for elements with the specified data-testid attribute. |
| getByText(text[, options]) | Returns a locator for elements containing the specified text. |
| getByTitle(title[, options]) | Returns a locator for elements with the specified title attribute. |
| locator(selector[, options]) | Returns a new chained locator for the given selector within the frame. |
Was this page helpful?
Related resources from Grafana Labs

