You can use the Selenium2Library Get Element Attribute keyword to get the style attribute:
| | ${style}= | Get element attribute | id=check_style@style
You can then use the regex to find the background color attribute or perform additional parsing. The latter would be easier to do in python than with robot keywords.
For example, if you understand regular expressions, something like the following may work. Of course, you probably want to add bulletproofness.
| | ${style}= | get element attribute | id=check_style@style | | ${color}= | evaluate | re.search("background-color: *(.*?);", '''${style}''').group(1) | re
Note. You may not get the same literal meaning as in raw HTML. For example, on my machine, ${color} returned as rgb(255, 204, 0) , although the color in HTML is #ffcc00 .
source share