MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / frame

Method frame

javascript/selenium-webdriver/lib/webdriver.js:2548–2555  ·  view source on GitHub ↗

* Changes the focus of all future commands to another frame on the page. The * target frame may be specified as one of the following: * * - A number that specifies a (zero-based) index into [window.frames]( * https://developer.mozilla.org/en-US/docs/Web/API/Window.frames). * - A {@l

(id)

Source from the content-addressed store, hash-verified

2546 * when the driver has changed focus to the specified frame.
2547 */
2548 frame(id) {
2549 let frameReference = id
2550 if (typeof id === 'string') {
2551 frameReference = this.driver_.findElement({ id }).catch((_) => this.driver_.findElement({ name: id }))
2552 }
2553
2554 return this.driver_.execute(new command.Command(command.Name.SWITCH_TO_FRAME).setParameter('id', frameReference))
2555 }
2556
2557 /**
2558 * Changes the focus of all future commands to the parent frame of the

Callers

nothing calls this directly

Calls 3

setParameterMethod · 0.80
findElementMethod · 0.65
executeMethod · 0.65

Tested by

no test coverage detected