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

Method id

py/selenium/webdriver/remote/webelement.py:500–510  ·  view source on GitHub ↗

Get the ID used by selenium. This is mainly for internal use. Simple use cases such as checking if 2 webelements refer to the same element, can be done using ``==``:: Example: if element1 == element2: print("These 2 are equal")

(self)

Source from the content-addressed store, hash-verified

498
499 @property
500 def id(self) -> str:
501 """Get the ID used by selenium.
502
503 This is mainly for internal use. Simple use cases such as checking if 2
504 webelements refer to the same element, can be done using ``==``::
505
506 Example:
507 if element1 == element2:
508 print("These 2 are equal")
509 """
510 return self._id
511
512 def __eq__(self, element):
513 return hasattr(element, "id") and self._id == element.id

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected