webdriverio
Version:
Next-gen browser and mobile automation test framework for Node.js
29 lines (28 loc) • 1.15 kB
TypeScript
import type { ChainablePromiseElement } from '../../types.js';
/**
* Switch the Classic session into a frame.
*
* In a WebDriver BiDi session this command throws. Hold the browsing context
* from `browser.url()` or `browser.newWindow()` and call `context.frame()`.
* `context.parent` is the frame you came from. There is no `switchFrame(null)`.
*
* In a Classic session, pass an element or `null` for the top frame. A string
* or a function is rejected.
*
* <example>
:switchFrame.js
// Classic
await browser.switchFrame($('iframe'))
await browser.switchFrame(null)
// BiDi
const page = await browser.url('https://example.com')
const child = await page.frame('iframe')
console.log(await child.getTitle())
* </example>
*
* @alias browser.switchFrame
* @param {Element|null} context frame element, or `null` for the top frame (Classic only)
* @return {void}
*/
export declare function switchFrame(this: WebdriverIO.Browser, context: WebdriverIO.Element | ChainablePromiseElement | string | null | ((tree: unknown) => boolean | Promise<boolean>)): Promise<void>;
//# sourceMappingURL=switchFrame.d.ts.map