Page
Namespace: Glutinum.Playwright Parent: Glutinum.Playwright.global
type Page abstract member addStyleTag : options : options option -> Promise<ElementHandle> abstract member clearConsoleMessages : Promise<unit> abstract member clearPageErrors : Promise<unit> abstract member close : options : options option -> Promise<unit> abstract member locator : selector : string -> options : options option -> Locator abstract member pause : Promise<unit> abstract member resume : Promise<unit> abstract member setContent : html : string -> options : options option -> Promise<unit>
Methods
Adds a <link rel="stylesheet"> tag into the page with the desired url or a <style type="text/css"> tag with the
content. Returns the added tag when the stylesheet’s onload fires or when the CSS content was injected into frame.
options : options option
Clears all stored console messages from this page. Subsequent calls to page.consoleMessages([options]) will only return messages logged after the clear.
Clears all stored page errors from this page. Subsequent calls to page.pageErrors([options]) will only return errors thrown after the clear.
If runBeforeUnload is false,
does not run any unload handlers and waits for the page to be closed. If
runBeforeUnload is true the
method will run unload handlers, but will not wait for the page to close.
By default, page.close() does not run beforeunload handlers.
NOTE if runBeforeUnload is
passed as true, a beforeunload dialog might be summoned and should be handled manually via
page.on(‘dialog’) event.
options : options option
The method returns an element locator that can be used to perform actions on this page / frame. Locator is resolved to the element immediately before performing an action, so a series of actions on the same locator can in fact be performed on different DOM elements. That would happen if the DOM structure between those actions has changed.
Parametersselector : string
A selector to use when resolving DOM element.
options : options option
Pauses script execution. Playwright will stop executing the script and wait for the user to either press the
‘Resume’ button in the page overlay or to call playwright.resume() in the DevTools console.
User can inspect selectors or perform manual steps while paused. Resume will continue running the original script from the place it was paused.
NOTE This method requires Playwright to be started in a headed mode, with a falsy
headless option.
Resumes script execution. Throws if the debugger is not paused.
This method internally calls document.write(), inheriting all its specific characteristics and behaviors.
Parametershtml : string
HTML markup to assign to the page.
options : options option