From 195f9bdfb19e6e979a2a5f240a284a50cd939133 Mon Sep 17 00:00:00 2001 From: AutomatedTester Date: Fri, 10 Jun 2016 08:57:59 +0100 Subject: [PATCH] Add a test to make sure still support elements locators that use css escape chars --- common/src/web/idElements.html | 2 ++ .../webdriver/common/driver_element_finding_tests.py | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 common/src/web/idElements.html diff --git a/common/src/web/idElements.html b/common/src/web/idElements.html new file mode 100644 index 0000000000000..47f0834cacc04 --- /dev/null +++ b/common/src/web/idElements.html @@ -0,0 +1,2 @@ + +
Element with a dot in the id
diff --git a/py/test/selenium/webdriver/common/driver_element_finding_tests.py b/py/test/selenium/webdriver/common/driver_element_finding_tests.py index 1dcf9031e309b..950427ddb7cc7 100755 --- a/py/test/selenium/webdriver/common/driver_element_finding_tests.py +++ b/py/test/selenium/webdriver/common/driver_element_finding_tests.py @@ -37,6 +37,11 @@ def test_Should_Be_Able_To_Find_ASingle_Element_By_Numeric_Id(self): element = self.driver.find_element(By.ID, "2") self.assertEqual(element.get_attribute("id"), "2") + def test_should_be_able_to_find_an_element_with_css_escape(self): + self._load_page("idElements") + element = self.driver.find_element(By.ID, "with.dots") + self.assertEqual(element.get_attribute("id"), "with.dots") + def test_Should_Be_Able_To_Find_Multiple_Elements_By_Id(self): self._load_page("nestedElements") elements = self.driver.find_elements(By.ID, "test_id")