Skip to content

Commit c8fe7ba

Browse files
committed
Add get_element() for method name standardization
1 parent cafc4d9 commit c8fe7ba

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,6 +2147,14 @@ def wait_for_element_present(self, selector, by=By.CSS_SELECTOR,
21472147
return page_actions.wait_for_element_present(
21482148
self.driver, selector, by, timeout)
21492149

2150+
def get_element(self, selector, by=By.CSS_SELECTOR,
2151+
timeout=settings.LARGE_TIMEOUT):
2152+
""" Same as wait_for_element_present() - returns the element.
2153+
The element does not need be visible (it may be hidden). """
2154+
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
2155+
timeout = self.__get_new_timeout(timeout)
2156+
return self.wait_for_element_present(selector, by=by, timeout=timeout)
2157+
21502158
def assert_element_present(self, selector, by=By.CSS_SELECTOR,
21512159
timeout=settings.SMALL_TIMEOUT):
21522160
""" Similar to wait_for_element_present(), but returns nothing.

0 commit comments

Comments
 (0)