MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / wait_for_attribute

Method wait_for_attribute

seleniumbase/fixtures/base_case.py:8488–8515  ·  view source on GitHub ↗

Raises an exception if the element attribute/value is not found. If the value is not specified, the attribute only needs to exist. Returns the element that contains the attribute if successful. Default timeout = LARGE_TIMEOUT.

(
        self, selector, attribute, value=None, by="css selector", timeout=None
    )

Source from the content-addressed store, hash-verified

8486 return self.assertRaises(*args, **kwargs)
8487
8488 def wait_for_attribute(
8489 self, selector, attribute, value=None, by="css selector", timeout=None
8490 ):
8491 """Raises an exception if the element attribute/value is not found.
8492 If the value is not specified, the attribute only needs to exist.
8493 Returns the element that contains the attribute if successful.
8494 Default timeout = LARGE_TIMEOUT."""
8495 self.__check_scope()
8496 if not timeout:
8497 timeout = settings.LARGE_TIMEOUT
8498 if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
8499 timeout = self.__get_new_timeout(timeout)
8500 selector, by = self.__recalculate_selector(selector, by)
8501 if self.__is_cdp_swap_needed():
8502 self.cdp.assert_element_attribute(selector, attribute, value)
8503 return
8504 elif self.__is_shadow_selector(selector):
8505 return self.__wait_for_shadow_attribute_present(
8506 selector, attribute, value=value, timeout=timeout
8507 )
8508 return page_actions.wait_for_attribute(
8509 self.driver,
8510 selector,
8511 attribute,
8512 value=value,
8513 by=by,
8514 timeout=timeout,
8515 )
8516
8517 def assert_attribute(
8518 self, selector, attribute, value=None, by="css selector", timeout=None

Callers 10

assert_attributeMethod · 0.95
wachten_op_attribuutMethod · 0.80
attendre_un_attributMethod · 0.80
espera_el_atributoMethod · 0.80
属性を待つMethod · 0.80
等待属性Method · 0.80
aguardar_o_atributoMethod · 0.80

Calls 7

__check_scopeMethod · 0.95
__get_new_timeoutMethod · 0.95
__is_cdp_swap_neededMethod · 0.95
__is_shadow_selectorMethod · 0.95

Tested by

no test coverage detected