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

Method assert_element_attribute

seleniumbase/core/sb_cdp.py:3264–3277  ·  view source on GitHub ↗
(self, selector, attribute, value=None)

Source from the content-addressed store, hash-verified

3262 return True
3263
3264 def assert_element_attribute(self, selector, attribute, value=None):
3265 attributes = self.get_element_attributes(selector)
3266 if attribute not in attributes:
3267 raise Exception(
3268 "Attribute {%s} was not found in element {%s}!"
3269 % (attribute, selector)
3270 )
3271 if value and attributes[attribute] != value:
3272 raise Exception(
3273 "Expected value {%s} of attribute {%s} "
3274 "was not found in element {%s}! "
3275 "(Actual value was {%s})"
3276 % (value, attribute, selector, attributes[attribute])
3277 )
3278
3279 def assert_title(self, title):
3280 expected = title.strip()

Callers 2

wait_for_attributeMethod · 0.80
assert_attributeMethod · 0.80

Calls 1

Tested by

no test coverage detected