Skip to content

Commit 195f9bd

Browse files
Add a test to make sure still support elements locators that use css escape chars
1 parent f2ba921 commit 195f9bd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

common/src/web/idElements.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!DOCTYPE html>
2+
<div id="with.dots">Element with a dot in the id</div>

py/test/selenium/webdriver/common/driver_element_finding_tests.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ def test_Should_Be_Able_To_Find_ASingle_Element_By_Numeric_Id(self):
3737
element = self.driver.find_element(By.ID, "2")
3838
self.assertEqual(element.get_attribute("id"), "2")
3939

40+
def test_should_be_able_to_find_an_element_with_css_escape(self):
41+
self._load_page("idElements")
42+
element = self.driver.find_element(By.ID, "with.dots")
43+
self.assertEqual(element.get_attribute("id"), "with.dots")
44+
4045
def test_Should_Be_Able_To_Find_Multiple_Elements_By_Id(self):
4146
self._load_page("nestedElements")
4247
elements = self.driver.find_elements(By.ID, "test_id")

0 commit comments

Comments
 (0)