Skip to content

Commit

Permalink
Update FirefoxDriver to send both 'ELEMENT' and 'element-6066-11e4-a5…
Browse files Browse the repository at this point in the history
…2e-4f735466cecf' when finding elements and returning elements
  • Loading branch information
AutomatedTester committed Mar 3, 2015
1 parent d5b792d commit a1d7320
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions javascript/firefox-driver/js/firefoxDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ FirefoxDriver.prototype.findElementInternal_ = function(respond, method,

if (element) {
var id = Utils.addToKnownElements(element);
respond.value = {'ELEMENT': id};
respond.value = {'ELEMENT': id, 'element-6066-11e4-a52e-4f735466cecf': id};
return respond.send();
}

Expand Down Expand Up @@ -550,7 +550,7 @@ FirefoxDriver.prototype.findElementsInternal_ = function(respond, method,
for (var j = 0; j < elements.length; j++) {
var element = elements[j];
var elementId = Utils.addToKnownElements(element);
elementIds.push({'ELEMENT': elementId});
elementIds.push({'ELEMENT': elementId, 'element-6066-11e4-a52e-4f735466cecf': elementId});
}

var wait = respond.session.getImplicitWait();
Expand Down Expand Up @@ -628,12 +628,13 @@ FirefoxDriver.prototype.switchToFrame = function(respond, parameters) {
goog.log.info(FirefoxDriver.LOG_,
'Switching to frame by index: ' + parameters.id);
newWindow = bot.frame.findFrameByIndex(parameters.id, currentWindow);
} else if (goog.isObject(parameters.id) && 'ELEMENT' in parameters.id) {
} else if (goog.isObject(parameters.id) &&
('ELEMENT' in parameters.id) || 'element-6066-11e4-a52e-4f735466cecf' in parameters.id) {
var elId = parameters.id['element-6066-11e4-a52e-4f735466cecf'] ? parameters.id['element-6066-11e4-a52e-4f735466cecf'] : parameters.id['ELEMENT']
goog.log.info(FirefoxDriver.LOG_,
'Switching to frame by element: ' + parameters.id['ELEMENT']);
'Switching to frame by element: ' + elId);

var element = Utils.getElementAt(parameters.id['ELEMENT'],
currentWindow.document);
var element = Utils.getElementAt(elId, currentWindow.document);

element = fxdriver.moz.unwrapFor4(element);

Expand Down Expand Up @@ -680,7 +681,7 @@ FirefoxDriver.prototype.getActiveElement = function(respond) {
var element = Utils.getActiveElement(respond.session.getDocument());
var id = Utils.addToKnownElements(element);

respond.value = {'ELEMENT': id};
respond.value = {'ELEMENT': id, 'element-6066-11e4-a52e-4f735466cecf': id};
respond.send();
};

Expand Down

0 comments on commit a1d7320

Please sign in to comment.