Questions tagged [value-of-css-property]

For questions about value_of_css_property() - the method provided by the web browser automation tool called "Selenium" that returns the value of a CSS property of a WebElement. When using this tag also include the more generic [selenium] tag where possible.

value_of_css_property

value_of_css_property() method returns the value of a CSS property of a WebElement.


Definition

This method is defined as:

def value_of_css_property(self, property_name):
    """The value of a CSS property."""
    return self._execute(Command.GET_ELEMENT_VALUE_OF_CSS_PROPERTY, {
        'propertyName': property_name})['value']

References

value_of_css_property()

17 questions
4
votes
4 answers

How to get background-image from inline css using selenium

Using python how can I get the background image using selenium? Which has an inline CSS? I want to get the image URL from the background-image: url()
Anjali
  • 187
  • 1
  • 4
  • 12
3
votes
1 answer

How to get the hover button background color of a website using selenium?

Hello I am using python selenium to get some css propertiew of a button. I need also the hover background color. The css is like this: .overview .add-to-cart-button:hover, .variant-overview .add-to-cart-button:hover { background-color: #b41733;} My…
2
votes
1 answer

How to test a component HSL background color in cypress? ( Typescript )

I'm using a CSS module for my styling, and I want to test the background color of the button, but it's in hsl not RGB. I have seen people struggle with the same issue, but they found solutions like chai-color or color libraries. The problem is I use…
2
votes
2 answers

Why is Selenium is giving me a case insensitive Style attribute?

I'm trying to get the "Style" attribute from the following item:
Bzero3
  • 33
  • 3
1
vote
1 answer

Why do you write '-webkit-touch-callout: none' when applying css to ios?

I was writing a css that only applies to iOS. When I searched, most people used '@support(-webkit-touch-callout:none)' to write css. Touch callout is a menu that comes out when you press and hold the link on the iPhone. But I wonder why I have to…
Moseon
  • 11
  • 1
1
vote
4 answers

Can you change a css property for a specific page?

So I have a problem with my footer: I have two pages which use specific position values and due to them being different to all the others, the footer when set to position: absolute bottom: 0 isn't sticking to the bottom and is buggy... for the 2…
Pauli
  • 17
  • 5
1
vote
1 answer

what is the difference between "embed" and "isolate" values in "unicode-bidi" css property?

Please see examples. There I wrote code for these two values which give the same result. hayti