Bug 1274550 - Return web element from Get Active Element; r?automatedtester
MozReview-Commit-ID: I5WHfJbMfPZ
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -1061,29 +1061,20 @@ function* findElementsContent(strategy,
}
let els = yield element.find(curContainer, strategy, selector, opts);
let elRefs = seenEls.addAll(els);
let webEls = elRefs.map(element.makeWebElement);
return webEls;
}
-/**
- * Find and return the active element on the page.
- *
- * @return {WebElement}
- * Reference to web element.
- */
+/** Find and return the active element on the page. */
function getActiveElement() {
let el = curContainer.frame.document.activeElement;
- let elRef = seenEls.add(el);
- // TODO(ato): This incorrectly returns
- // the element's associated UUID as a string
- // instead of a web element.
- return elRef;
+ return element.toJson(el, seenEls);
}
/**
* Send click event to element.
*
* @param {WebElement} id
* Reference to the web element to click.
*/