Class webdriver.WebDriver.TargetLocator
code »An interface for changing the focus of the driver to another frame or window.
Constructor
Parameters |
---|
|
Instance Methods
Schedules a command retrieve the document.activeElement
element on
the current document, or document.body
if activeElement is not
available.
document.activeElement
element on
the current document, or document.body
if activeElement is not
available.Returns |
---|
|
Schedules a command to change focus to the active alert dialog. This command
will return a bot.ErrorCode.NO_SUCH_ALERT
error if an alert dialog
is not currently open.
bot.ErrorCode.NO_SUCH_ALERT
error if an alert dialog
is not currently open.Returns |
---|
|
code »defaultContent ( ) ⇒ !webdriver.promise.Promise.<void>
Schedules a command to switch focus of all future commands to the first frame
on the page.
!webdriver.promise.Promise.<void>
Returns |
---|
|
code »frame ( nameOrIndex ) ⇒ !webdriver.promise.Promise.<void>
Schedules a command to switch the focus of all future commands to another
frame on the page.
If the frame is specified by a number, the command will switch to the frame
by its (zero-based) index into the window.frames
collection.
If the frame is specified by a string, the command will select the frame by
its name or ID. To select sub-frames, simply separate the frame names/IDs by
dots. As an example, "main.child" will select the frame with the name "main"
and then its child "child".
If the specified frame can not be found, the deferred result will errback
with a bot.ErrorCode.NO_SUCH_FRAME
error.
!webdriver.promise.Promise.<void>
code »window ( nameOrHandle ) ⇒ !webdriver.promise.Promise.<void>
Schedules a command to switch the focus of all future commands to another
window. Windows may be specified by their window.name
attribute or
by its handle (as returned by webdriver.WebDriver#getWindowHandles
).
If the specificed window can not be found, the deferred result will errback
with a bot.ErrorCode.NO_SUCH_WINDOW
error.
!webdriver.promise.Promise.<void>
window.name
attribute or
by its handle (as returned by webdriver.WebDriver#getWindowHandles
).
Parameters |
---|
|
Returns |
|