FrameLocator
Playwright\Frame\FrameLocatorInterface
Methods
locator()
LocatorInterfaceCreate a locator within this frame.
function locator(string $selector): LocatorInterface
getByAltText()
LocatorInterfacefunction getByAltText(string $text, array $options = []): LocatorInterface
getByLabel()
LocatorInterfacefunction getByLabel(string $text, array $options = []): LocatorInterface
getByPlaceholder()
LocatorInterfacefunction getByPlaceholder(string $text, array $options = []): LocatorInterface
getByRole()
LocatorInterfacefunction getByRole(string $role, array $options = []): LocatorInterface
getByTestId()
LocatorInterfacefunction getByTestId(string $testId): LocatorInterface
getByText()
LocatorInterfacefunction getByText(string $text, array $options = []): LocatorInterface
getByTitle()
LocatorInterfacefunction getByTitle(string $text, array $options = []): LocatorInterface
first()
selfGet the first frame matching the selector.
function first(): self
last()
selfGet the last frame matching the selector.
function last(): self
nth()
selfGet the nth frame matching the selector (0-indexed).
function nth(int $index): self
frameLocator()
selfCreate a nested frame locator.
function frameLocator(string $selector): self
getSelector()
stringGet the frame selector.
function getSelector(): string
owner()
LocatorInterfaceGet locator for the frame element itself.
function owner(): LocatorInterface