diff --git a/testing/marionette/marionette-server.js b/testing/marionette/marionette-server.js index ee58a90fd788..621ae09b6d68 100644 --- a/testing/marionette/marionette-server.js +++ b/testing/marionette/marionette-server.js @@ -1621,6 +1621,26 @@ MarionetteServerConnection.prototype = { } }, + /** + * Find element using the indicated search strategy + * starting from a known element. Used for WebDriver Compatibility only. + * @param {object} aRequest + * 'using' member indicates which search method to use + * 'value' member is the value the client is looking for + * 'id' member is the value of the element to start from + */ + findChildElement: function MDA_findChildElement(aRequest) { + let command_id = this.command_id = this.getCommandId(); + this.sendAsync("findElementContent", + { + value: aRequest.parameters.value, + using: aRequest.parameters.using, + element: aRequest.parameters.id, + searchTimeout: this.searchTimeout + }, + command_id); + }, + /** * Find elements using the indicated search strategy. * @@ -1660,6 +1680,26 @@ MarionetteServerConnection.prototype = { } }, + /** + * Find elements using the indicated search strategy + * starting from a known element. Used for WebDriver Compatibility only. + * @param {object} aRequest + * 'using' member indicates which search method to use + * 'value' member is the value the client is looking for + * 'id' member is the value of the element to start from + */ + findChildElements: function MDA_findChildElement(aRequest) { + let command_id = this.command_id = this.getCommandId(); + this.sendAsync("findElementsContent", + { + value: aRequest.parameters.value, + using: aRequest.parameters.using, + element: aRequest.parameters.id, + searchTimeout: this.searchTimeout + }, + command_id); + }, + /** * Return the active element on the page */ @@ -2615,7 +2655,9 @@ MarionetteServerConnection.prototype.requestTypes = { "executeJSScript": MarionetteServerConnection.prototype.executeJSScript, "setSearchTimeout": MarionetteServerConnection.prototype.setSearchTimeout, "findElement": MarionetteServerConnection.prototype.findElement, + "findChildElement": MarionetteServerConnection.prototype.findChildElements, // Needed for WebDriver compat "findElements": MarionetteServerConnection.prototype.findElements, + "findChildElements":MarionetteServerConnection.prototype.findChildElements, // Needed for WebDriver compat "clickElement": MarionetteServerConnection.prototype.clickElement, "getElementAttribute": MarionetteServerConnection.prototype.getElementAttribute, "getElementText": MarionetteServerConnection.prototype.getElementText,