diff --git a/testing/marionette/client/marionette/marionette.py b/testing/marionette/client/marionette/marionette.py index a033f65e9970..010d83e9c148 100644 --- a/testing/marionette/client/marionette/marionette.py +++ b/testing/marionette/client/marionette/marionette.py @@ -1298,7 +1298,7 @@ class Marionette(object): :param method: The method to use to locate the element; one of: "id", "name", "class name", "tag name", "css selector", "link text", "partial link text", "xpath", "anon" and "anon attribute". - Note that the "name", "css selector", "link text" and + Note that the "name", "link text" and "partial link test" methods are not supported in the chrome dom. :param target: The target of the search. For example, if method = "tag", target might equal "div". If method = "id", target would be @@ -1325,7 +1325,7 @@ class Marionette(object): :param method: The method to use to locate the elements; one of: "id", "name", "class name", "tag name", "css selector", "link text", "partial link text", "xpath", "anon" and "anon attribute". - Note that the "name", "css selector", "link text" and + Note that the "name", "link text" and "partial link test" methods are not supported in the chrome dom. :param target: The target of the search. For example, if method = "tag", target might equal "div". If method = "id", target would be diff --git a/testing/marionette/client/marionette/tests/unit/test_findelement_chrome.py b/testing/marionette/client/marionette/tests/unit/test_findelement_chrome.py index cb0d98eb4dcd..4d13b1f6b295 100644 --- a/testing/marionette/client/marionette/tests/unit/test_findelement_chrome.py +++ b/testing/marionette/client/marionette/tests/unit/test_findelement_chrome.py @@ -29,6 +29,12 @@ class TestElementsChrome(MarionetteTestCase): self.assertEqual(HTMLElement, type(found_el)) self.assertEqual(el, found_el) + def test_that_we_can_find_elements_from_css_selectors(self): + el = self.marionette.execute_script("return window.document.getElementById('textInput');") + found_el = self.marionette.find_element(By.CSS_SELECTOR, "#textInput") + self.assertEqual(HTMLElement, type(found_el)) + self.assertEqual(el, found_el) + def test_child_element(self): el = self.marionette.find_element(By.ID, "textInput") parent = self.marionette.find_element(By.ID, "things") diff --git a/testing/marionette/marionette-server.js b/testing/marionette/marionette-server.js index 1ee99f192e23..e8e54480874e 100644 --- a/testing/marionette/marionette-server.js +++ b/testing/marionette/marionette-server.js @@ -2899,7 +2899,7 @@ function BrowserObj(win, server) { this.startPage = "about:blank"; this.mainContentId = null; // used in B2G to identify the homescreen content page this.newSession = true; //used to set curFrameId upon new session - this.elementManager = new ElementManager([SELECTOR, NAME, LINK_TEXT, PARTIAL_LINK_TEXT]); + this.elementManager = new ElementManager([NAME, LINK_TEXT, PARTIAL_LINK_TEXT]); this.setBrowser(win); this.frameManager = new FrameManager(server); //We should have one FM per BO so that we can handle modals in each Browser