Selenium IDE: how to check text color using CSS
1 answer
style.colorwill return color if the actual DOM element has an attribute style. In your case, when the color is defined in the tag <style>, it will not work. For this you need to use getComputedStyle(). However, it colorreturns the color in RGB format, but you can convert the color manually and check the result of RGB.
Like this:
assertEval(
"window.document.defaultView.getComputedStyle(window.document.getElementsByClassName('title')[0]).getPropertyValue('color')",
"rgb(204, 51, 51)"
)
N.B. selenium.browserbot.getCurrentWindow() window. , .
+4