seleniumhq.github.io icon indicating copy to clipboard operation
seleniumhq.github.io copied to clipboard

[🚀 Feature]: Documentation example is using a deprecated API, it should be updated

Open amitbiswal007 opened this issue 9 months ago • 1 comments

Feature and motivation

This is regarding the official documentation under the page "Webdriver > Elements > Information" https://www.selenium.dev/documentation/webdriver/elements/information/

In this page, there is an example under the section "Fetching Attributes or Properties". This example uses the below API in Java. String valueInfo = emailTxt.getAttribute("value");

Image

However, In latest Java libraries, we can see that "getAttribute()" method is deprecated. The official documentation suggests the usage of [getDomProperty(String)] or [getDomAttribute(String)] See Reference - https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/WebElement.html#getAttribute(java.lang.String)

The documentation example should be updated with the latest library methods instead of using a deprecated method.

amitbiswal007 avatar Mar 04 '25 16:03 amitbiswal007

@amitbiswal007, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] avatar Mar 04 '25 16:03 github-actions[bot]

I think, getAttribute() still exists, but we do have two more methods with the API, so the documentation should reflect that. https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/WebElement.html#getAttribute(java.lang.String)

reference - 4.33 release notes https://www.selenium.dev/blog/2025/selenium-4-33-released/ https://github.com/SeleniumHQ/selenium/commit/ef05c15798b22a3ade4bb1f111d3e1955988e267

closing this PR. new one should be created to update documentation for new methods which are introduced in the API.

rpallavisharma avatar Oct 04 '25 11:10 rpallavisharma