Class WithinFrame
java.lang.Object
net.serenitybdd.screenplay.playwright.interactions.WithinFrame
Perform actions within an iframe.
Example usage:
actor.attemptsTo(
WithinFrame.locatedBy("#my-iframe")
.click("#button-inside-frame")
);
// Or for complex operations:
actor.attemptsTo(
WithinFrame.locatedBy("#my-iframe")
.perform(frame -> {
frame.locator("#username").fill("user");
frame.locator("#password").fill("pass");
frame.locator("#submit").click();
})
);
-
Method Summary
Modifier and TypeMethodDescriptionnet.serenitybdd.screenplay.PerformableClear an input within the frame.net.serenitybdd.screenplay.PerformableClick on an element within the frame.net.serenitybdd.screenplay.PerformableFill a value into an input within the frame.static WithinFrameLocate an iframe by its selector.net.serenitybdd.screenplay.PerformablePerform custom actions within the frame using the FrameLocator.net.serenitybdd.screenplay.PerformableGet text from an element within the frame.
-
Method Details
-
locatedBy
Locate an iframe by its selector. -
click
Click on an element within the frame. -
fill
Fill a value into an input within the frame. -
clear
Clear an input within the frame. -
type
Get text from an element within the frame. -
perform
public net.serenitybdd.screenplay.Performable perform(Consumer<com.microsoft.playwright.FrameLocator> actions) Perform custom actions within the frame using the FrameLocator.
-