Dart API ReferencewebdriverWebDriverWindow

WebDriverWindow class

class WebDriverWindow extends WebDriverBase {
  WebDriverWindow.fromUrl(url) : super.fromUrl(url);

  /** Get the window size. */
  Future<Map> getSize() => _get('size');

  /**
   * Set the window size.
   *
   * Potential Errors:
   *   NoSuchWindow - If the specified window cannot be found.
   */
  Future<String> setSize(int width, int height) =>
      _post('size', params: { 'width': width, 'height': height });

  /** Get the window position. */
  Future<Map> getPosition() => _get('position');

  /**
   * Set the window position.
   *
   * Potential Errors: NoSuchWindow.
   */
  Future setPosition(int x, int y) =>
      _post('position', params: { 'x': x, 'y': y });

  /** Maximize the specified window if not already maximized. */
  Future maximize() => _post('maximize');
}

Extends

WebDriverBase > WebDriverWindow

Constructors

new WebDriverWindow.fromUrl(url) #

WebDriverWindow.fromUrl(url) : super.fromUrl(url);

Properties

final String path #

inherited from WebDriverBase
String get path => _path;

final String url #

inherited from WebDriverBase
String get url => _url;

Methods

Future<Map> getPosition() #

Get the window position.

Future<Map> getPosition() => _get('position');

Future<Map> getSize() #

Get the window size.

Future<Map> getSize() => _get('size');

Future maximize() #

Maximize the specified window if not already maximized.

Future maximize() => _post('maximize');

Future setPosition(int x, int y) #

Set the window position.

Potential Errors: NoSuchWindow.

Future setPosition(int x, int y) =>
    _post('position', params: { 'x': x, 'y': y });

Future<String> setSize(int width, int height) #

Set the window size.

Potential Errors: NoSuchWindow - If the specified window cannot be found.

Future<String> setSize(int width, int height) =>
    _post('size', params: { 'width': width, 'height': height });