Bug 1274550 - Return web element from Get Active Element; r=automatedtester
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 26 May 2016 13:04:22 +0100
changeset 299213 8218106c37b44d6d56945d198a41b44ba224b7d5
parent 299212 c08a10627942f3fc0ecd054e0497e36baa9f0637
child 299214 cdac1e9c5416558e08f32e507f61ac6a33c1036f
push id30291
push userryanvm@gmail.com
push dateFri, 27 May 2016 01:45:30 +0000
treeherdermozilla-central@4d63dde701b4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester
bugs1274550
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1274550 - Return web element from Get Active Element; r=automatedtester MozReview-Commit-ID: I5WHfJbMfPZ
testing/marionette/listener.js
--- 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.
  */