-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
added get dom property and get dom attribute method information #2529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
✅ Deploy Preview for selenium-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The tests failure doesn't look related to this PR. Kindly check this. |
| ## Fetching Attributes or Properties | ||
| ## Fetching Attributes and Properties | ||
|
|
||
| ### Get Attribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be we need to be more precise now with the difeerences between getAtrribute, getDomAttribute and getDomProperty
example:
Returns the element's property value if present, otherwise falls back to the attribute value. This convenience method handles the common case but can be ambiguous. For precise control, use getDomProperty() or getDomAttribute() instead.
@diemol any thoughts !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are showing in here how to use it. Let me know if any changes are needed at code level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harsha509 getAttribute() is actually deprecated for just that reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including a synopsis of this information would be helpful: What's the difference between an "attribute" and a "property" in the DOM? | Quiz Interview Questions with Solutions https://share.google/lB3bUx9KDK28LOx9B
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sbabcoc,
I’m already aware of the distinction, this is exactly why I asked for the documentation to clearly outline the difference in a way users can understand.
Also getAtrribute is not deprecated yet in selenium see https://github.com/SeleniumHQ/selenium/blob/trunk/java/CHANGELOG
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are showing in here how to use it. Let me know if any changes are needed at code level?
HI @rpallavisharma ,
Not in the code samples, i was referring to documentation.
so currently in docs for getAtrribute we have
Fetches the run time value associated with a DOM attribute. It returns the data associated with the DOM attribute or property of the element.
we can change to
Returns the element's property value if present, otherwise falls back to the attribute value. This convenience method handles the common case but can be ambiguous. For precise control, use getDomProperty() or getDomAttribute() instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harsha509 in this PR, i haven't acted on the existing part of documentation. i have added the new methods. please evaluate this PR on that basis. if the information is correct, which it is according to my understading in the document and code, kindly accept the PR.
i believe what you are saying is modifying an existing definition. which this PR doesn't do.
kindly let me know.
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
User description
Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.
Added information of Get Dom Property and Get Dom Attribute.
Provided code for java, added for all languages
Description
Added information of Get Dom Property and Get Dom Attribute.
Provided code for java, added for all languages
Motivation and Context
information about these methods were missing
Types of changes
Checklist
PR Type
Documentation, Enhancement
Description
Added
getDomProperty()andgetDomAttribute()method documentationImplemented Java test examples for both new methods
Updated documentation across multiple language versions (English, Japanese, Portuguese, Chinese)
Reorganized section header from "Fetching Attributes or Properties" to "Fetching Attributes and Properties"
Diagram Walkthrough
File Walkthrough
InformationTest.java
Add getDomProperty and getDomAttribute test examplesexamples/java/src/test/java/dev/selenium/elements/InformationTest.java
getDomProperty("value")methodgetDomAttribute("value")methodinformation.en.md
Add DOM property and attribute method documentationwebsite_and_docs/content/documentation/webdriver/elements/information.en.md
documentation
reference
reference
Kotlin
information.ja.md
Add DOM property and attribute documentation in Japanesewebsite_and_docs/content/documentation/webdriver/elements/information.ja.md
documentation
reference
reference
languages
information.pt-br.md
Add DOM property and attribute documentation in Portuguesewebsite_and_docs/content/documentation/webdriver/elements/information.pt-br.md
documentation
reference
reference
information.zh-cn.md
Add DOM property and attribute documentation in Chinesewebsite_and_docs/content/documentation/webdriver/elements/information.zh-cn.md
reference
reference
Kotlin