# How to test css features

**URL:** <https://forum.robotframework.org/t/how-to-test-css-features/6079>\
**Category:** Browser\
**Created:** [9 August 2023 06:22 UTC](https://forum.robotframework.org/t/how-to-test-css-features/6079 "2023-08-09T06:22:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahesh](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@Mahesh](https://forum.robotframework.org/u/Mahesh)\
**Post date:** [9 August 2023 06:22 UTC](https://forum.robotframework.org/t/how-to-test-css-features/6079/1 "2023-08-09T06:22:16Z")

</div>

How to Validate Css features. For example to test  
Color of the element .

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [9 August 2023 07:12 UTC](https://forum.robotframework.org/t/how-to-test-css-features/6079/2 "2023-08-09T07:12:15Z")

</div>

Hi Mahesh,

Depends on which library you are using?

If Browser library, you have [Get Style](https://marketsquare.github.io/robotframework-browser/Browser.html#Get%20Style) which would be the easiest way.

You could also use something like [Evaluate JavaScript](https://marketsquare.github.io/robotframework-browser/Browser.html#Evaluate%20JavaScript) or [Execute Javascript](https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Execute%20Javascript) to run the javascript function `getComputedStyle` on the page to compute the resultant CSS

Alternatively you could use [Get Classes](https://marketsquare.github.io/robotframework-browser/Browser.html#Get%20Classes), [Get Attribute](https://marketsquare.github.io/robotframework-browser/Browser.html#Get%20Attribute), or [Get Element Attribute](https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Get%20Element%20Attribute) to get the classes or style attributes from the element your interested in but some of these might only give you values directly applied to the element not values the element inherited which is why you’d be better using javascript to compute `getComputedStyle` or using BrowserLibrary’s [Get Style](https://marketsquare.github.io/robotframework-browser/Browser.html#Get%20Style) which also computes the resultant style.

Hopefully one of those options will work for you,

Dave.
