From bb3053ba23a5798fa65fd2bb52bbb174ac0a98d2 Mon Sep 17 00:00:00 2001 From: Simon Benzer <69980130+shbenzer@users.noreply.github.com> Date: Sun, 3 Nov 2024 14:40:42 -0500 Subject: [PATCH] [py] Added Deprecation of WebElement.get_attribute() per #13334 (#14675) --- py/selenium/webdriver/remote/webelement.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/py/selenium/webdriver/remote/webelement.py b/py/selenium/webdriver/remote/webelement.py index 08c772eaad56e..e5a3adad0d7b4 100644 --- a/py/selenium/webdriver/remote/webelement.py +++ b/py/selenium/webdriver/remote/webelement.py @@ -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(