diff --git a/py/selenium/webdriver/support/expected_conditions.py b/py/selenium/webdriver/support/expected_conditions.py index 06a5f36d9e7c6..d17351104612a 100644 --- a/py/selenium/webdriver/support/expected_conditions.py +++ b/py/selenium/webdriver/support/expected_conditions.py @@ -428,6 +428,8 @@ def text_to_be_present_in_element_value( def _predicate(driver: WebDriverOrWebElement): try: element_text = driver.find_element(*locator).get_attribute("value") + if element_text is None: + return False return text_ in element_text except StaleElementReferenceException: return False