Skip to content

Commit babd957

Browse files
[py] Fix possible TypeError in expected conditions (#15891)
Co-authored-by: Corey Goldberg <1113081+cgoldberg@users.noreply.github.com>
1 parent 1fe6d27 commit babd957

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

py/selenium/webdriver/support/expected_conditions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ def text_to_be_present_in_element_value(
428428
def _predicate(driver: WebDriverOrWebElement):
429429
try:
430430
element_text = driver.find_element(*locator).get_attribute("value")
431+
if element_text is None:
432+
return False
431433
return text_ in element_text
432434
except StaleElementReferenceException:
433435
return False

0 commit comments

Comments
 (0)