-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Sample of Get Element CSS Value #527
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
Conversation
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 @Peyton88 ,
Thanks for the PR!
get Element css value actually returns a value of computed css style property of an element. we have WebDriver method like getCssValue
in JS. The code sample you've provided is for getAttribute
i've updated doc with a code sample for JS. https://www.selenium.dev/documentation/fr/webdriver/web_element/#get-element-css-value
can you please update the code samples accordingly.
Thank you !
Thanks. I got a misunderstanding. |
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 @Peyton88 ,
Thank you for making the changes. and apologies for reverting it, there are couple of things required to get this pr merged !
- Can you please fill/complete the above checklist.
- Semicolons are not required in few language bindings like kotlin, ruby, python can you please look into the suggested changes
- Can you please make the same changes in other translated pages too like (es,fr,zh-cn).
Thank you!
driver.get 'https://www.example.com' | ||
|
||
# Retrieves the computed style property 'color' of linktext | ||
cssValue = driver.find_element(:link_text, 'More information...').css_value('color'); |
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.
cssValue = driver.find_element(:link_text, 'More information...').css_value('color'); | |
cssValue = driver.find_element(:link_text, 'More information...').css_value('color') |
// Please provide a pr for the code sample | ||
|
||
// Navigate to Url | ||
driver.get('https://www.example.com'); |
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.
driver.get('https://www.example.com'); | |
driver.get('https://www.example.com') |
driver.get('https://www.example.com'); | ||
|
||
# Retrieves the computed style property 'color' of linktext | ||
cssValue = driver.findElement(By.LINK_TEXT, "More information...").value_of_css_property('color'); |
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.
cssValue = driver.findElement(By.LINK_TEXT, "More information...").value_of_css_property('color'); | |
cssValue = driver.findElement(By.LINK_TEXT, "More information...").value_of_css_property('color') |
// Please provide a pr for the code sample | ||
|
||
# Navigate to Url | ||
driver.get('https://www.example.com'); |
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.
driver.get('https://www.example.com'); | |
driver.get('https://www.example.com') |
driver.get('https://www.example.com'); | ||
|
||
// Retrieves the computed style property 'color' of linktext | ||
val cssValue = driver.findElement(By.linkText("More information...")).getCssValue('color'); |
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.
val cssValue = driver.findElement(By.linkText("More information...")).getCssValue('color'); | |
val cssValue = driver.findElement(By.linkText("More information...")).getCssValue('color') |
Hi @harsha509 , Thanks for your kindly reminding. |
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.
Thank you @Peyton88 !
deploy-preview looks good ! |
Co-authored-by: Sri Harsha <[email protected]> bae2e36
Congratulations on your first contribution @Peyton88 🎉 🎉 🎉 🎉 🎉 |
Thanks you~ |
Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Motivation and Context
Types of changes
Checklist