module Playwright::Frame

Overview

At every point of time, page exposes its current frame tree via the page.mainFrame() and frame.childFrames() methods. Frame object's lifecycle is controlled by three events, dispatched on the page object:

page.on('frameattached') - fired when the frame gets attached to the page. A Frame can be attached to the page only once. page.on('framenavigated') - fired when the frame commits navigation to a different URL. page.on('framedetached') - fired when the frame gets detached from the page. A Frame can be detached from the page only once.

An example of dumping frame tree:

An example of getting text from an iframe element:

Defined in:

playwright/frame.cr

Instance Method Summary

Instance Method Detail

abstract def add_script_tag(params : AddScriptTagParams) : ElementHandle #

Returns the added tag when the script's onload fires or when the script content was injected into frame. Adds a