Skip to content

Commit 316f2eb

Browse files
committed
Avoid checking exception details for invalid locators due to differences in server implementations
1 parent 985a800 commit 316f2eb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

py/test/selenium/webdriver/common/children_finding_tests.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,14 @@ def test_should_be_able_to_find_multiple_elements_by_css_selector(self):
155155
def test_should_throw_an_error_if_user_passes_in_invalid_by(self):
156156
self._load_page("nestedElements")
157157
element = self.driver.find_element_by_name("form2")
158-
with pytest.raises(WebDriverException) as excinfo:
158+
with pytest.raises(WebDriverException):
159159
element.find_element("foo", "bar")
160-
assert 'Unsupported locator strategy: foo' in str(excinfo.value)
161160

162161
def test_should_throw_an_error_if_user_passes_in_invalid_by_when_find_elements(self):
163162
self._load_page("nestedElements")
164163
element = self.driver.find_element_by_name("form2")
165-
with pytest.raises(WebDriverException) as excinfo:
164+
with pytest.raises(WebDriverException):
166165
element.find_elements("foo", "bar")
167-
assert 'Unsupported locator strategy: foo' in str(excinfo.value)
168166

169167
def _page_url(self, name):
170168
return self.webserver.where_is(name + '.html')

0 commit comments

Comments
 (0)