diff --git a/testing/marionette/element.js b/testing/marionette/element.js index fee712108dd5..02095c5cadb2 100644 --- a/testing/marionette/element.js +++ b/testing/marionette/element.js @@ -161,7 +161,7 @@ element.Store = class { * @returns {nsIDOMElement} * Element associated with reference. * - * @throws {JavaScriptError} + * @throws {NoSuchElementError} * If the provided reference is unknown. * @throws {StaleElementReferenceError} * If element has gone stale, indicating it is no longer attached to @@ -170,7 +170,8 @@ element.Store = class { get(uuid, container) { let el = this.els[uuid]; if (!el) { - throw new JavaScriptError(`Element reference not seen before: ${uuid}`); + throw new NoSuchElementError(`Element reference not seen before: ` + + `${uuid}`); } try { diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_screenshot.py b/testing/marionette/harness/marionette_harness/tests/unit/test_screenshot.py index 097dd91ba864..8dea63c21c00 100644 --- a/testing/marionette/harness/marionette_harness/tests/unit/test_screenshot.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_screenshot.py @@ -9,7 +9,7 @@ import struct import urllib from marionette_driver import By -from marionette_driver.errors import JavascriptException, NoSuchWindowException +from marionette_driver.errors import NoSuchElementException, NoSuchWindowException from marionette_harness import ( MarionetteTestCase, skip, @@ -275,12 +275,12 @@ class TestScreenCaptureChrome(WindowManagerMixin, ScreenCaptureTestCase): self.marionette.navigate(box) content_element = self.marionette.find_element(By.ID, "green") - self.assertRaisesRegexp(JavascriptException, "Element reference not seen before", + self.assertRaisesRegexp(NoSuchElementException, "Element reference not seen before", self.marionette.screenshot, highlights=[content_element]) chrome_document_element = self.document_element with self.marionette.using_context('content'): - self.assertRaisesRegexp(JavascriptException, "Element reference not seen before", + self.assertRaisesRegexp(NoSuchElementException, "Element reference not seen before", self.marionette.screenshot, highlights=[chrome_document_element])