A browser window
w <- s$getWindow() wlist <- s$getAllWindows() w$close() w$isActive() w$switchTo() w$maximize() w$getSize() w$setSize(width, height) w$getPosition() w$setPosition(x, y)
A Session
object.
A Window
object.
A list of Window
objects.
Integer scalar, requested width of the window.
Integer scalar, requested height of the window.
Integer scalar, requested horizontal window position.
Integer scalar, requested vertical window position.
The getWindow
method of a Session
object
returns the current browser window as a Window
object.
The getAllWindows
method returns a list of window objects,
all browser windows.
w$close()
closes the window.
w$isActive()
returns TRUE
if the window is active,
FALSE
otherwise.
w$switchTo
makes the window active.
w$maximize
maximizes the window. Currently it sets it to
a fixed size.
w$getSize
returns the size of the window, in a list with
elementh width
and height
, both integers.
w$setSize
sets the size of the window.
w$getPosition
returns the position of the window on the
screen. Phantom.js being headless, it always returns
list(x = 0, y = 0)
, and it is included to have a complete
impelementation of the WebDriver standard.
w$setPosition(x, y)
sets the position of the window on the
screen. Phantom.js being headless, it has no effect, and it is included
to have a complete implementation of the WebDriver standard.