Skip to content

Commit 409b057

Browse files
fenilgmehtasymonk
andauthored
[py]: 🚀 Improve performance (#11310)
* Improve performance - reduce `find_element` calls * Reduce calls to `get_attribute` Co-authored-by: Simon K <jackofspaces@gmail.com>
1 parent 8b6dbb3 commit 409b057

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎py/selenium/webdriver/support/expected_conditions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ def text_to_be_present_in_element_attribute(locator, attribute_, text_):
234234

235235
def _predicate(driver):
236236
try:
237-
if not element_attribute_to_include(locator, attribute_)(driver):
238-
return False
239237
element_text = driver.find_element(*locator).get_attribute(attribute_)
238+
if element_text is None:
239+
return False
240240
return text_ in element_text
241241
except StaleElementReferenceException:
242242
return False

0 commit comments

Comments
 (0)