frameLocator by Name
You can target frames by any CSS selector, including [name="frameName"].
On the Frames page, the nested frame has name="nestedFrame" and contains <h2>Parent frame</h2>.
Task:
- Navigate to
https://testkru.com/Interactions/Frames - Access the frame with
page.frameLocator()and an attribute selector that matches itsname - Get the h2 text inside and print it
Expected output:
Parent frame text: Parent frame
TestKru