2015-04-04 09:53:59 -07:00
|
|
|
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
|
|
|
// or more contributor license agreements. See the NOTICE file
|
|
|
|
|
// distributed with this work for additional information
|
|
|
|
|
// regarding copyright ownership. The SFC licenses this file
|
|
|
|
|
// to you under the Apache License, Version 2.0 (the
|
|
|
|
|
// "License"); you may not use this file except in compliance
|
|
|
|
|
// with the License. You may obtain a copy of the License at
|
2014-11-12 19:33:37 +00:00
|
|
|
//
|
2015-04-04 09:53:59 -07:00
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
2014-11-12 19:33:37 +00:00
|
|
|
//
|
2015-04-04 09:53:59 -07:00
|
|
|
// Unless required by applicable law or agreed to in writing,
|
|
|
|
|
// software distributed under the License is distributed on an
|
|
|
|
|
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
|
// KIND, either express or implied. See the License for the
|
|
|
|
|
// specific language governing permissions and limitations
|
|
|
|
|
// under the License.
|
2013-06-22 15:37:10 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @fileoverview Defines the webdriver.Capabilities class.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
goog.provide('webdriver.Browser');
|
|
|
|
|
goog.provide('webdriver.Capabilities');
|
2013-08-16 11:53:17 -07:00
|
|
|
goog.provide('webdriver.Capability');
|
2014-08-20 21:09:18 -07:00
|
|
|
goog.provide('webdriver.ProxyConfig');
|
2013-06-22 15:37:10 -07:00
|
|
|
|
2015-04-19 09:04:54 -07:00
|
|
|
goog.require('webdriver.logging');
|
2014-09-11 03:45:33 -07:00
|
|
|
|
2013-06-22 15:37:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Recognized browser names.
|
|
|
|
|
* @enum {string}
|
2018-11-25 15:31:54 +00:00
|
|
|
* @suppress {lintChecks}
|
2013-06-22 15:37:10 -07:00
|
|
|
*/
|
|
|
|
|
webdriver.Browser = {
|
|
|
|
|
ANDROID: 'android',
|
|
|
|
|
CHROME: 'chrome',
|
|
|
|
|
FIREFOX: 'firefox',
|
2015-02-21 09:59:24 -08:00
|
|
|
IE: 'internet explorer',
|
2013-06-22 15:37:10 -07:00
|
|
|
INTERNET_EXPLORER: 'internet explorer',
|
2016-01-07 16:52:18 -08:00
|
|
|
EDGE: 'MicrosoftEdge',
|
2013-10-03 20:57:26 +04:00
|
|
|
IPAD: 'iPad',
|
|
|
|
|
IPHONE: 'iPhone',
|
2015-02-28 13:07:36 -08:00
|
|
|
OPERA: 'opera',
|
2013-06-22 15:37:10 -07:00
|
|
|
PHANTOM_JS: 'phantomjs',
|
2013-10-03 20:57:26 +04:00
|
|
|
SAFARI: 'safari',
|
|
|
|
|
HTMLUNIT: 'htmlunit'
|
2013-06-22 15:37:10 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-20 21:09:18 -07:00
|
|
|
/**
|
|
|
|
|
* Describes how a proxy should be configured for a WebDriver session.
|
|
|
|
|
* Proxy configuration object, as defined by the WebDriver wire protocol.
|
|
|
|
|
* @typedef {(
|
|
|
|
|
* {proxyType: string}|
|
|
|
|
|
* {proxyType: string,
|
|
|
|
|
* proxyAutoconfigUrl: string}|
|
|
|
|
|
* {proxyType: string,
|
|
|
|
|
* ftpProxy: string,
|
|
|
|
|
* httpProxy: string,
|
|
|
|
|
* sslProxy: string,
|
|
|
|
|
* noProxy: string})}
|
|
|
|
|
*/
|
|
|
|
|
webdriver.ProxyConfig;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-22 15:37:10 -07:00
|
|
|
/**
|
|
|
|
|
* Common webdriver capability keys.
|
|
|
|
|
* @enum {string}
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capability = {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Indicates whether a driver should accept all SSL certs by default. This
|
|
|
|
|
* capability only applies when requesting a new session. To query whether
|
2015-02-15 20:16:33 -08:00
|
|
|
* a driver can handle insecure SSL certs, see {@link #SECURE_SSL}.
|
2013-06-22 15:37:10 -07:00
|
|
|
*/
|
|
|
|
|
ACCEPT_SSL_CERTS: 'acceptSslCerts',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The browser name. Common browser names are defined in the
|
|
|
|
|
* {@link webdriver.Browser} enum.
|
|
|
|
|
*/
|
|
|
|
|
BROWSER_NAME: 'browserName',
|
|
|
|
|
|
2014-08-20 21:09:18 -07:00
|
|
|
/**
|
|
|
|
|
* Defines how elements should be scrolled into the viewport for interaction.
|
|
|
|
|
* This capability will be set to zero (0) if elements are aligned with the
|
|
|
|
|
* top of the viewport, or one (1) if aligned with the bottom. The default
|
|
|
|
|
* behavior is to align with the top of the viewport.
|
|
|
|
|
*/
|
|
|
|
|
ELEMENT_SCROLL_BEHAVIOR: 'elementScrollBehavior',
|
|
|
|
|
|
2013-06-22 15:37:10 -07:00
|
|
|
/**
|
|
|
|
|
* Whether the driver is capable of handling modal alerts (e.g. alert,
|
|
|
|
|
* confirm, prompt). To define how a driver <i>should</i> handle alerts,
|
2015-02-15 20:16:33 -08:00
|
|
|
* use {@link #UNEXPECTED_ALERT_BEHAVIOR}.
|
2013-06-22 15:37:10 -07:00
|
|
|
*/
|
|
|
|
|
HANDLES_ALERTS: 'handlesAlerts',
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Key for the logging driver logging preferences.
|
|
|
|
|
*/
|
|
|
|
|
LOGGING_PREFS: 'loggingPrefs',
|
|
|
|
|
|
2014-08-20 21:09:18 -07:00
|
|
|
/**
|
|
|
|
|
* Whether this session generates native events when simulating user input.
|
|
|
|
|
*/
|
|
|
|
|
NATIVE_EVENTS: 'nativeEvents',
|
|
|
|
|
|
2013-06-22 15:37:10 -07:00
|
|
|
/**
|
|
|
|
|
* Describes the platform the browser is running on. Will be one of
|
|
|
|
|
* ANDROID, IOS, LINUX, MAC, UNIX, or WINDOWS. When <i>requesting</i> a
|
|
|
|
|
* session, ANY may be used to indicate no platform preference (this is
|
|
|
|
|
* semantically equivalent to omitting the platform capability).
|
|
|
|
|
*/
|
|
|
|
|
PLATFORM: 'platform',
|
|
|
|
|
|
2013-06-26 22:16:09 -07:00
|
|
|
/**
|
|
|
|
|
* Describes the proxy configuration to use for a new WebDriver session.
|
|
|
|
|
*/
|
|
|
|
|
PROXY: 'proxy',
|
|
|
|
|
|
2020-08-16 00:03:35 +05:30
|
|
|
/** Whether the driver supports changing the browser's orientation. */
|
2013-06-22 15:37:10 -07:00
|
|
|
ROTATABLE: 'rotatable',
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Whether a driver is only capable of handling secure SSL certs. To request
|
|
|
|
|
* that a driver accept insecure SSL certs by default, use
|
2015-02-15 20:16:33 -08:00
|
|
|
* {@link #ACCEPT_SSL_CERTS}.
|
2013-06-22 15:37:10 -07:00
|
|
|
*/
|
|
|
|
|
SECURE_SSL: 'secureSsl',
|
|
|
|
|
|
|
|
|
|
/** Whether the driver supports manipulating the app cache. */
|
|
|
|
|
SUPPORTS_APPLICATION_CACHE: 'applicationCacheEnabled',
|
|
|
|
|
|
|
|
|
|
/** Whether the driver supports locating elements with CSS selectors. */
|
|
|
|
|
SUPPORTS_CSS_SELECTORS: 'cssSelectorsEnabled',
|
|
|
|
|
|
|
|
|
|
/** Whether the browser supports JavaScript. */
|
|
|
|
|
SUPPORTS_JAVASCRIPT: 'javascriptEnabled',
|
|
|
|
|
|
|
|
|
|
/** Whether the driver supports controlling the browser's location info. */
|
|
|
|
|
SUPPORTS_LOCATION_CONTEXT: 'locationContextEnabled',
|
|
|
|
|
|
|
|
|
|
/** Whether the driver supports taking screenshots. */
|
|
|
|
|
TAKES_SCREENSHOT: 'takesScreenshot',
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Defines how the driver should handle unexpected alerts. The value should
|
|
|
|
|
* be one of "accept", "dismiss", or "ignore.
|
|
|
|
|
*/
|
|
|
|
|
UNEXPECTED_ALERT_BEHAVIOR: 'unexpectedAlertBehavior',
|
|
|
|
|
|
|
|
|
|
/** Defines the browser version. */
|
|
|
|
|
VERSION: 'version'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2013-06-23 20:19:52 -07:00
|
|
|
* @param {(webdriver.Capabilities|Object)=} opt_other Another set of
|
2013-06-22 15:37:10 -07:00
|
|
|
* capabilities to merge into this instance.
|
|
|
|
|
* @constructor
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities = function(opt_other) {
|
|
|
|
|
|
2014-10-30 11:14:52 -07:00
|
|
|
/** @private {!Object.<string, ?>} */
|
2013-06-22 15:37:10 -07:00
|
|
|
this.caps_ = {};
|
|
|
|
|
|
|
|
|
|
if (opt_other) {
|
|
|
|
|
this.merge(opt_other);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2013-06-23 10:05:45 -07:00
|
|
|
* @return {!webdriver.Capabilities} A basic set of capabilities for Android.
|
2013-06-22 15:37:10 -07:00
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.android = function() {
|
|
|
|
|
return new webdriver.Capabilities().
|
|
|
|
|
set(webdriver.Capability.BROWSER_NAME, webdriver.Browser.ANDROID).
|
|
|
|
|
set(webdriver.Capability.PLATFORM, 'ANDROID');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2013-06-23 10:05:45 -07:00
|
|
|
* @return {!webdriver.Capabilities} A basic set of capabilities for Chrome.
|
2013-06-22 15:37:10 -07:00
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.chrome = function() {
|
|
|
|
|
return new webdriver.Capabilities().
|
|
|
|
|
set(webdriver.Capability.BROWSER_NAME, webdriver.Browser.CHROME);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2013-06-23 10:05:45 -07:00
|
|
|
* @return {!webdriver.Capabilities} A basic set of capabilities for Firefox.
|
2013-06-22 15:37:10 -07:00
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.firefox = function() {
|
|
|
|
|
return new webdriver.Capabilities().
|
|
|
|
|
set(webdriver.Capability.BROWSER_NAME, webdriver.Browser.FIREFOX);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2013-06-23 10:05:45 -07:00
|
|
|
* @return {!webdriver.Capabilities} A basic set of capabilities for
|
2013-06-22 15:37:10 -07:00
|
|
|
* Internet Explorer.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.ie = function() {
|
|
|
|
|
return new webdriver.Capabilities().
|
|
|
|
|
set(webdriver.Capability.BROWSER_NAME,
|
|
|
|
|
webdriver.Browser.INTERNET_EXPLORER).
|
|
|
|
|
set(webdriver.Capability.PLATFORM, 'WINDOWS');
|
|
|
|
|
};
|
|
|
|
|
|
2016-01-07 16:52:18 -08:00
|
|
|
/**
|
|
|
|
|
* @return {!webdriver.Capabilities} A basic set of capabilities for
|
|
|
|
|
* Microsoft Edge.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.edge = function() {
|
|
|
|
|
return new webdriver.Capabilities().
|
2020-01-31 01:42:06 +03:00
|
|
|
set(webdriver.Capability.BROWSER_NAME, webdriver.Browser.EDGE);
|
2016-01-07 16:52:18 -08:00
|
|
|
};
|
|
|
|
|
|
2013-06-22 15:37:10 -07:00
|
|
|
|
|
|
|
|
/**
|
2013-06-23 10:05:45 -07:00
|
|
|
* @return {!webdriver.Capabilities} A basic set of capabilities for iPad.
|
2013-06-22 15:37:10 -07:00
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.ipad = function() {
|
|
|
|
|
return new webdriver.Capabilities().
|
|
|
|
|
set(webdriver.Capability.BROWSER_NAME, webdriver.Browser.IPAD).
|
|
|
|
|
set(webdriver.Capability.PLATFORM, 'MAC');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2013-06-23 10:05:45 -07:00
|
|
|
* @return {!webdriver.Capabilities} A basic set of capabilities for iPhone.
|
2013-06-22 15:37:10 -07:00
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.iphone = function() {
|
|
|
|
|
return new webdriver.Capabilities().
|
|
|
|
|
set(webdriver.Capability.BROWSER_NAME, webdriver.Browser.IPHONE).
|
|
|
|
|
set(webdriver.Capability.PLATFORM, 'MAC');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2015-02-28 13:07:36 -08:00
|
|
|
/**
|
|
|
|
|
* @return {!webdriver.Capabilities} A basic set of capabilities for Opera.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.opera = function() {
|
|
|
|
|
return new webdriver.Capabilities().
|
|
|
|
|
set(webdriver.Capability.BROWSER_NAME, webdriver.Browser.OPERA);
|
|
|
|
|
};
|
|
|
|
|
|
2013-06-22 15:37:10 -07:00
|
|
|
/**
|
2013-06-23 10:05:45 -07:00
|
|
|
* @return {!webdriver.Capabilities} A basic set of capabilities for
|
2013-06-22 15:37:10 -07:00
|
|
|
* PhantomJS.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.phantomjs = function() {
|
|
|
|
|
return new webdriver.Capabilities().
|
|
|
|
|
set(webdriver.Capability.BROWSER_NAME, webdriver.Browser.PHANTOM_JS);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2013-06-23 10:05:45 -07:00
|
|
|
* @return {!webdriver.Capabilities} A basic set of capabilities for Safari.
|
2013-06-22 15:37:10 -07:00
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.safari = function() {
|
|
|
|
|
return new webdriver.Capabilities().
|
2015-10-22 09:32:41 -07:00
|
|
|
set(webdriver.Capability.BROWSER_NAME, webdriver.Browser.SAFARI).
|
|
|
|
|
set(webdriver.Capability.PLATFORM, 'MAC');
|
2013-06-22 15:37:10 -07:00
|
|
|
};
|
|
|
|
|
|
2013-11-13 12:56:36 -08:00
|
|
|
|
2013-10-03 20:57:26 +04:00
|
|
|
/**
|
|
|
|
|
* @return {!webdriver.Capabilities} A basic set of capabilities for HTMLUnit.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.htmlunit = function() {
|
|
|
|
|
return new webdriver.Capabilities().
|
|
|
|
|
set(webdriver.Capability.BROWSER_NAME, webdriver.Browser.HTMLUNIT);
|
|
|
|
|
};
|
|
|
|
|
|
2013-11-13 12:56:36 -08:00
|
|
|
|
2013-10-03 20:57:26 +04:00
|
|
|
/**
|
|
|
|
|
* @return {!webdriver.Capabilities} A basic set of capabilities for HTMLUnit
|
2013-11-13 12:56:36 -08:00
|
|
|
* with enabled Javascript.
|
2013-10-03 20:57:26 +04:00
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.htmlunitwithjs = function() {
|
|
|
|
|
return new webdriver.Capabilities().
|
|
|
|
|
set(webdriver.Capability.BROWSER_NAME, webdriver.Browser.HTMLUNIT).
|
|
|
|
|
set(webdriver.Capability.SUPPORTS_JAVASCRIPT, true);
|
|
|
|
|
};
|
2013-06-22 15:37:10 -07:00
|
|
|
|
2013-11-13 12:56:36 -08:00
|
|
|
|
2014-10-30 11:14:52 -07:00
|
|
|
/**
|
|
|
|
|
* @return {!Object.<string, ?>} The JSON representation of this instance. Note,
|
|
|
|
|
* the returned object may contain nested promises that are promised values.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.prototype.serialize = function() {
|
|
|
|
|
return this.caps_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2013-06-22 15:37:10 -07:00
|
|
|
/**
|
|
|
|
|
* Merges another set of capabilities into this instance. Any duplicates in
|
|
|
|
|
* the provided set will override those already set on this instance.
|
|
|
|
|
* @param {!(webdriver.Capabilities|Object)} other The capabilities to
|
|
|
|
|
* merge into this instance.
|
|
|
|
|
* @return {!webdriver.Capabilities} A self reference.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.prototype.merge = function(other) {
|
|
|
|
|
var caps = other instanceof webdriver.Capabilities ?
|
|
|
|
|
other.caps_ : other;
|
|
|
|
|
for (var key in caps) {
|
|
|
|
|
if (caps.hasOwnProperty(key)) {
|
|
|
|
|
this.set(key, caps[key]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return this;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {string} key The capability to set.
|
|
|
|
|
* @param {*} value The capability value. Capability values must be JSON
|
2018-11-25 15:31:54 +00:00
|
|
|
* serializable. Pass `null` to unset the capability.
|
2013-06-22 15:37:10 -07:00
|
|
|
* @return {!webdriver.Capabilities} A self reference.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.prototype.set = function(key, value) {
|
|
|
|
|
if (goog.isDefAndNotNull(value)) {
|
|
|
|
|
this.caps_[key] = value;
|
|
|
|
|
} else {
|
|
|
|
|
delete this.caps_[key];
|
|
|
|
|
}
|
|
|
|
|
return this;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {string} key The capability to return.
|
2018-11-25 15:31:54 +00:00
|
|
|
* @return {*} The capability with the given key, or `null` if it has
|
2013-06-22 15:37:10 -07:00
|
|
|
* not been set.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.prototype.get = function(key) {
|
|
|
|
|
var val = null;
|
|
|
|
|
if (this.caps_.hasOwnProperty(key)) {
|
|
|
|
|
val = this.caps_[key];
|
|
|
|
|
}
|
|
|
|
|
return goog.isDefAndNotNull(val) ? val : null;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {string} key The capability to check.
|
|
|
|
|
* @return {boolean} Whether the specified capability is set.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.prototype.has = function(key) {
|
|
|
|
|
return !!this.get(key);
|
|
|
|
|
};
|
2014-08-20 21:09:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the logging preferences. Preferences may be specified as a
|
|
|
|
|
* {@link webdriver.logging.Preferences} instance, or a as a map of log-type to
|
|
|
|
|
* log-level.
|
|
|
|
|
* @param {!(webdriver.logging.Preferences|Object.<string, string>)} prefs The
|
|
|
|
|
* logging preferences.
|
|
|
|
|
* @return {!webdriver.Capabilities} A self reference.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.prototype.setLoggingPrefs = function(prefs) {
|
|
|
|
|
return this.set(webdriver.Capability.LOGGING_PREFS, prefs);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the proxy configuration for this instance.
|
|
|
|
|
* @param {webdriver.ProxyConfig} proxy The desired proxy configuration.
|
|
|
|
|
* @return {!webdriver.Capabilities} A self reference.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.prototype.setProxy = function(proxy) {
|
|
|
|
|
return this.set(webdriver.Capability.PROXY, proxy);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets whether native events should be used.
|
|
|
|
|
* @param {boolean} enabled Whether to enable native events.
|
|
|
|
|
* @return {!webdriver.Capabilities} A self reference.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.prototype.setEnableNativeEvents = function(enabled) {
|
|
|
|
|
return this.set(webdriver.Capability.NATIVE_EVENTS, enabled);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets how elements should be scrolled into view for interaction.
|
|
|
|
|
* @param {number} behavior The desired scroll behavior: either 0 to align with
|
|
|
|
|
* the top of the viewport or 1 to align with the bottom.
|
|
|
|
|
* @return {!webdriver.Capabilities} A self reference.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.prototype.setScrollBehavior = function(behavior) {
|
|
|
|
|
return this.set(webdriver.Capability.ELEMENT_SCROLL_BEHAVIOR, behavior);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the default action to take with an unexpected alert before returning
|
|
|
|
|
* an error.
|
2014-08-24 18:12:32 -07:00
|
|
|
* @param {string} behavior The desired behavior; should be "accept", "dismiss",
|
2014-08-20 21:09:18 -07:00
|
|
|
* or "ignore". Defaults to "dismiss".
|
|
|
|
|
* @return {!webdriver.Capabilities} A self reference.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Capabilities.prototype.setAlertBehavior = function(behavior) {
|
|
|
|
|
return this.set(webdriver.Capability.UNEXPECTED_ALERT_BEHAVIOR, behavior);
|
|
|
|
|
};
|