Skip to content

Commit

Permalink
[py] Added Deprecation of WebElement.get_attribute() per SeleniumHQ#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
shbenzer committed Oct 29, 2024
1 parent f391cd0 commit 4070ad0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions py/selenium/webdriver/remote/webelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ def get_attribute(self, name) -> str | None:
# Check if the "active" CSS class is applied to an element.
is_active = "active" in target_element.get_attribute("class")
"""

warnings.warn(
"using WebElement.get_attribute() has been deprecated. Please use get_dom_attribute() instead."
DeprecationWarning,
stacklevel=2,
)

if getAttribute_js is None:
_load_js()
attribute_value = self.parent.execute_script(
Expand Down

0 comments on commit 4070ad0

Please sign in to comment.