Contexts

session.getWindowHandle()

Get handle of current window

RETURNS

Promise<string>

EXAMPLES

const handle = await session.getWindowHandle();
// handle = 'CDwindow-7321145136535301DE771CCBD9555CEA'

SEE ALSO

session.closeWindow()

Close the current window.

RETURNS

Promise<void>

EXAMPLES

await session.closeWindow();

SEE ALSO

session.switchToWindow(handle)

Change focus to another window. The window to change focus to may be specified by it's server assigned window handle.

PARAMETERS

  • handle: string - Window handle to switch to

RETURNS

Promise<void>

EXAMPLES

await session.switchToWindow('CDwindow-7321145136535301DE771CCBD9555CEA');

SEE ALSO

session.getWindowHandles()

Get all window handles

RETURNS

Promise<string[]>

EXAMPLES

const handles = await session.getWindowHandles();
// handles = ['CDwindow-7321145136535301DE771CCBD9555CEA']

SEE ALSO

session.switchToFrame(target)

Change focus to another frame on the page

PARAMETERS

  • target: null | number | Element - Identifier for the frame to change focus to

RETURNS

Promise<void>

EXAMPLES

const iframe = await session.findElement('css selector', 'iframe');
await session.switchToFrame(iframe);
await session.switchToFrame(null);

SEE ALSO

session.switchToParentFrame()

Change focus to parent frame on the page

RETURNS

Promise<void>

EXAMPLES

await session.switchToParentFrame();

SEE ALSO

session.getWindowRect()

Get the size and position on the screen of the operating system window

RETURNS

Promise<WindowRect>

EXAMPLES

await session.getWindowRect();

SEE ALSO

session.setWindowRect(windowRect)

Set the size and position on the screen of the operating system window

PARAMETERS

RETURNS

Promise<void>

EXAMPLES

await session.setWindowRect({
  x: 10,
  y: 10,
  width: 320,
  height: 600
});

SEE ALSO

session.maximizeWindow()

Maximizes the current window

RETURNS

Promise<void>

EXAMPLES

await session.maximizeWindow();

SEE ALSO

session.minimizeWindow()

Minimizes the current window

RETURNS

Promise<void>

EXAMPLES

await session.minimizeWindow();

SEE ALSO

session.fullScreenWindow()

This command increases Current window to Full-Screen

RETURNS

Promise<void>

EXAMPLES

await session.fullScreenWindow();

SEE ALSO

WindowRect

An object defining the Window Rect.

PROPERTIES

  • x: number - The screenX and screenLeft attributes must return the x-coordinate, relative to the origin of the Web-exposed screen area, of the left of the client window as number of CSS pixels

  • y: number - The screenY and screenTop attributes must return the y-coordinate, relative to the origin of the screen of the Web-exposed screen area, of the top of the client window as number of CSS pixels

  • width: number - The outerWidth attribute must return the width of the client window. If there is no client window this attribute must return zero

  • height: number - The outerWidth attribute must return the height of the client window. If there is no client window this attribute must return zero

Last updated