MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / size

Method size

py/selenium/webdriver/remote/webelement.py:335–346  ·  view source on GitHub ↗

Get the size of the element. Returns: The width and height of the element. Example: size = element.size

(self)

Source from the content-addressed store, hash-verified

333
334 @property
335 def size(self) -> dict:
336 """Get the size of the element.
337
338 Returns:
339 The width and height of the element.
340
341 Example:
342 size = element.size
343 """
344 size = self._execute(Command.GET_ELEMENT_RECT)["value"]
345 new_size = {"height": size["height"], "width": size["width"]}
346 return new_size
347
348 def value_of_css_property(self, property_name) -> str:
349 """Get the value of a CSS property.

Callers 15

CopyDataMethod · 0.45
PushDataMethod · 0.45
PullDataMethod · 0.45
CopyWStringToBufferMethod · 0.45
CopyWStringFromBufferMethod · 0.45
SetProxySettingsMethod · 0.45
GetProxyAsJsonMethod · 0.45
RestoreProxySettingsMethod · 0.45

Calls 1

_executeMethod · 0.95

Tested by

no test coverage detected