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.
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @fileoverview Contains several classes for handling commands.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
goog.provide('webdriver.Command');
|
|
|
|
|
goog.provide('webdriver.CommandExecutor');
|
|
|
|
|
goog.provide('webdriver.CommandName');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Describes a command to be executed by the WebDriverJS framework.
|
2012-04-25 23:46:12 +00:00
|
|
|
* @param {!webdriver.CommandName} name The name of this command.
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
* @constructor
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Command = function(name) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The name of this command.
|
2013-03-10 13:56:37 -07:00
|
|
|
* @private {!webdriver.CommandName}
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
*/
|
|
|
|
|
this.name_ = name;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The parameters to this command.
|
2013-03-10 13:56:37 -07:00
|
|
|
* @private {!Object.<*>}
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
*/
|
|
|
|
|
this.parameters_ = {};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2012-04-25 23:46:12 +00:00
|
|
|
* @return {!webdriver.CommandName} This command's name.
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
*/
|
|
|
|
|
webdriver.Command.prototype.getName = function() {
|
|
|
|
|
return this.name_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets a parameter to send with this command.
|
|
|
|
|
* @param {string} name The parameter name.
|
|
|
|
|
* @param {*} value The parameter value.
|
|
|
|
|
* @return {!webdriver.Command} A self reference.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Command.prototype.setParameter = function(name, value) {
|
|
|
|
|
this.parameters_[name] = value;
|
|
|
|
|
return this;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the parameters for this command.
|
2011-10-24 21:33:37 +00:00
|
|
|
* @param {!Object.<*>} parameters The command parameters.
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
* @return {!webdriver.Command} A self reference.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Command.prototype.setParameters = function(parameters) {
|
|
|
|
|
this.parameters_ = parameters;
|
|
|
|
|
return this;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a named command parameter.
|
|
|
|
|
* @param {string} key The parameter key to look up.
|
|
|
|
|
* @return {*} The parameter value, or undefined if it has not been set.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.Command.prototype.getParameter = function(key) {
|
|
|
|
|
return this.parameters_[key];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2012-03-05 13:18:07 +00:00
|
|
|
* @return {!Object.<*>} The parameters to send with this command.
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
*/
|
|
|
|
|
webdriver.Command.prototype.getParameters = function() {
|
|
|
|
|
return this.parameters_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Enumeration of predefined names command names that all command processors
|
2012-04-25 23:46:12 +00:00
|
|
|
* will support.
|
|
|
|
|
* @enum {string}
|
2018-11-25 15:31:54 +00:00
|
|
|
* @suppress {lintChecks}
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
*/
|
2013-08-16 11:53:17 -07:00
|
|
|
// TODO: Delete obsolete command names.
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
webdriver.CommandName = {
|
2012-04-25 23:46:12 +00:00
|
|
|
GET_SERVER_STATUS: 'getStatus',
|
|
|
|
|
|
|
|
|
|
NEW_SESSION: 'newSession',
|
|
|
|
|
GET_SESSIONS: 'getSessions',
|
|
|
|
|
DESCRIBE_SESSION: 'getSessionCapabilities',
|
|
|
|
|
|
|
|
|
|
CLOSE: 'close',
|
|
|
|
|
QUIT: 'quit',
|
|
|
|
|
|
|
|
|
|
GET_CURRENT_URL: 'getCurrentUrl',
|
|
|
|
|
GET: 'get',
|
|
|
|
|
GO_BACK: 'goBack',
|
|
|
|
|
GO_FORWARD: 'goForward',
|
|
|
|
|
REFRESH: 'refresh',
|
|
|
|
|
|
|
|
|
|
ADD_COOKIE: 'addCookie',
|
|
|
|
|
GET_COOKIE: 'getCookie',
|
|
|
|
|
GET_ALL_COOKIES: 'getCookies',
|
|
|
|
|
DELETE_COOKIE: 'deleteCookie',
|
|
|
|
|
DELETE_ALL_COOKIES: 'deleteAllCookies',
|
|
|
|
|
|
|
|
|
|
GET_ACTIVE_ELEMENT: 'getActiveElement',
|
|
|
|
|
FIND_ELEMENT: 'findElement',
|
|
|
|
|
FIND_ELEMENTS: 'findElements',
|
|
|
|
|
FIND_CHILD_ELEMENT: 'findChildElement',
|
|
|
|
|
FIND_CHILD_ELEMENTS: 'findChildElements',
|
|
|
|
|
|
|
|
|
|
CLEAR_ELEMENT: 'clearElement',
|
|
|
|
|
CLICK_ELEMENT: 'clickElement',
|
|
|
|
|
SEND_KEYS_TO_ELEMENT: 'sendKeysToElement',
|
|
|
|
|
SUBMIT_ELEMENT: 'submitElement',
|
|
|
|
|
|
|
|
|
|
GET_CURRENT_WINDOW_HANDLE: 'getCurrentWindowHandle',
|
|
|
|
|
GET_WINDOW_HANDLES: 'getWindowHandles',
|
|
|
|
|
GET_WINDOW_POSITION: 'getWindowPosition',
|
|
|
|
|
SET_WINDOW_POSITION: 'setWindowPosition',
|
|
|
|
|
GET_WINDOW_SIZE: 'getWindowSize',
|
|
|
|
|
SET_WINDOW_SIZE: 'setWindowSize',
|
2012-07-07 05:21:50 +00:00
|
|
|
MAXIMIZE_WINDOW: 'maximizeWindow',
|
2012-04-25 23:46:12 +00:00
|
|
|
|
|
|
|
|
SWITCH_TO_WINDOW: 'switchToWindow',
|
|
|
|
|
SWITCH_TO_FRAME: 'switchToFrame',
|
|
|
|
|
GET_PAGE_SOURCE: 'getPageSource',
|
|
|
|
|
GET_TITLE: 'getTitle',
|
|
|
|
|
|
|
|
|
|
EXECUTE_SCRIPT: 'executeScript',
|
|
|
|
|
EXECUTE_ASYNC_SCRIPT: 'executeAsyncScript',
|
|
|
|
|
|
|
|
|
|
GET_ELEMENT_TEXT: 'getElementText',
|
|
|
|
|
GET_ELEMENT_TAG_NAME: 'getElementTagName',
|
|
|
|
|
IS_ELEMENT_SELECTED: 'isElementSelected',
|
|
|
|
|
IS_ELEMENT_ENABLED: 'isElementEnabled',
|
|
|
|
|
IS_ELEMENT_DISPLAYED: 'isElementDisplayed',
|
|
|
|
|
GET_ELEMENT_LOCATION: 'getElementLocation',
|
2012-06-08 21:45:58 +00:00
|
|
|
GET_ELEMENT_LOCATION_IN_VIEW: 'getElementLocationOnceScrolledIntoView',
|
2012-04-25 23:46:12 +00:00
|
|
|
GET_ELEMENT_SIZE: 'getElementSize',
|
|
|
|
|
GET_ELEMENT_ATTRIBUTE: 'getElementAttribute',
|
|
|
|
|
GET_ELEMENT_VALUE_OF_CSS_PROPERTY: 'getElementValueOfCssProperty',
|
|
|
|
|
ELEMENT_EQUALS: 'elementEquals',
|
|
|
|
|
|
|
|
|
|
SCREENSHOT: 'screenshot',
|
2015-11-01 20:12:44 -08:00
|
|
|
TAKE_ELEMENT_SCREENSHOT: 'takeElementScreenshot',
|
2012-04-25 23:46:12 +00:00
|
|
|
IMPLICITLY_WAIT: 'implicitlyWait',
|
|
|
|
|
SET_SCRIPT_TIMEOUT: 'setScriptTimeout',
|
2013-04-23 20:35:55 -07:00
|
|
|
SET_TIMEOUT: 'setTimeout',
|
2012-04-25 23:46:12 +00:00
|
|
|
|
|
|
|
|
ACCEPT_ALERT: 'acceptAlert',
|
|
|
|
|
DISMISS_ALERT: 'dismissAlert',
|
|
|
|
|
GET_ALERT_TEXT: 'getAlertText',
|
2012-11-05 02:48:38 +00:00
|
|
|
SET_ALERT_TEXT: 'setAlertValue',
|
2012-04-25 23:46:12 +00:00
|
|
|
|
|
|
|
|
EXECUTE_SQL: 'executeSQL',
|
|
|
|
|
GET_LOCATION: 'getLocation',
|
|
|
|
|
SET_LOCATION: 'setLocation',
|
|
|
|
|
GET_APP_CACHE: 'getAppCache',
|
|
|
|
|
GET_APP_CACHE_STATUS: 'getStatus',
|
|
|
|
|
CLEAR_APP_CACHE: 'clearAppCache',
|
|
|
|
|
IS_BROWSER_ONLINE: 'isBrowserOnline',
|
|
|
|
|
SET_BROWSER_ONLINE: 'setBrowserOnline',
|
|
|
|
|
|
|
|
|
|
GET_LOCAL_STORAGE_ITEM: 'getLocalStorageItem',
|
|
|
|
|
GET_LOCAL_STORAGE_KEYS: 'getLocalStorageKeys',
|
|
|
|
|
SET_LOCAL_STORAGE_ITEM: 'setLocalStorageItem',
|
|
|
|
|
REMOVE_LOCAL_STORAGE_ITEM: 'removeLocalStorageItem',
|
|
|
|
|
CLEAR_LOCAL_STORAGE: 'clearLocalStorage',
|
|
|
|
|
GET_LOCAL_STORAGE_SIZE: 'getLocalStorageSize',
|
|
|
|
|
|
|
|
|
|
GET_SESSION_STORAGE_ITEM: 'getSessionStorageItem',
|
|
|
|
|
GET_SESSION_STORAGE_KEYS: 'getSessionStorageKey',
|
|
|
|
|
SET_SESSION_STORAGE_ITEM: 'setSessionStorageItem',
|
|
|
|
|
REMOVE_SESSION_STORAGE_ITEM: 'removeSessionStorageItem',
|
|
|
|
|
CLEAR_SESSION_STORAGE: 'clearSessionStorage',
|
|
|
|
|
GET_SESSION_STORAGE_SIZE: 'getSessionStorageSize',
|
|
|
|
|
|
|
|
|
|
SET_SCREEN_ORIENTATION: 'setScreenOrientation',
|
|
|
|
|
GET_SCREEN_ORIENTATION: 'getScreenOrientation',
|
2012-03-20 16:39:10 +00:00
|
|
|
|
|
|
|
|
// These belong to the Advanced user interactions - an element is
|
|
|
|
|
// optional for these commands.
|
2012-04-25 23:46:12 +00:00
|
|
|
CLICK: 'mouseClick',
|
|
|
|
|
DOUBLE_CLICK: 'mouseDoubleClick',
|
2014-04-10 19:32:00 -07:00
|
|
|
MOUSE_DOWN: 'mouseButtonDown',
|
|
|
|
|
MOUSE_UP: 'mouseButtonUp',
|
|
|
|
|
MOVE_TO: 'mouseMoveTo',
|
2012-06-08 21:43:13 +00:00
|
|
|
SEND_KEYS_TO_ACTIVE_ELEMENT: 'sendKeysToActiveElement',
|
2012-03-20 16:39:10 +00:00
|
|
|
|
|
|
|
|
// These belong to the Advanced Touch API
|
2012-04-25 23:46:12 +00:00
|
|
|
TOUCH_SINGLE_TAP: 'touchSingleTap',
|
|
|
|
|
TOUCH_DOWN: 'touchDown',
|
|
|
|
|
TOUCH_UP: 'touchUp',
|
|
|
|
|
TOUCH_MOVE: 'touchMove',
|
|
|
|
|
TOUCH_SCROLL: 'touchScroll',
|
|
|
|
|
TOUCH_DOUBLE_TAP: 'touchDoubleTap',
|
|
|
|
|
TOUCH_LONG_PRESS: 'touchLongPress',
|
|
|
|
|
TOUCH_FLICK: 'touchFlick',
|
|
|
|
|
|
2013-04-28 18:12:33 -07:00
|
|
|
GET_AVAILABLE_LOG_TYPES: 'getAvailableLogTypes',
|
|
|
|
|
GET_LOG: 'getLog',
|
2015-02-11 09:28:48 -08:00
|
|
|
GET_SESSION_LOGS: 'getSessionLogs',
|
|
|
|
|
|
|
|
|
|
// Non-standard commands used by the standalone Selenium server.
|
|
|
|
|
UPLOAD_FILE: 'uploadFile'
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2012-09-09 05:20:57 +00:00
|
|
|
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
/**
|
2015-02-15 20:16:33 -08:00
|
|
|
* Handles the execution of WebDriver {@link webdriver.Command commands}.
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
* @interface
|
|
|
|
|
*/
|
|
|
|
|
webdriver.CommandExecutor = function() {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2018-11-25 15:31:54 +00:00
|
|
|
* Executes the given `command`. If there is an error executing the
|
2011-10-25 20:29:26 +00:00
|
|
|
* command, the provided callback will be invoked with the offending error.
|
|
|
|
|
* Otherwise, the callback will be invoked with a null Error and non-null
|
2012-04-29 04:33:52 +00:00
|
|
|
* {@link bot.response.ResponseObject} object.
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
* @param {!webdriver.Command} command The command to execute.
|
2016-05-19 15:08:51 -07:00
|
|
|
* @return {!goog.Promise<!bot.response.ResponseObject>} A promise
|
2015-11-13 14:12:26 -08:00
|
|
|
* that will be fulfilled with the command result.
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
*/
|
|
|
|
|
webdriver.CommandExecutor.prototype.execute = goog.abstractMethod;
|