Verify Background Color of Element

I am trying to follow the instructions from this older forum question -

I need to verify the color value of an element on our web page with Katalon Recorder. I followed the instructions on that page using Copy Selector, but Katalon doesn’t like it. What am I missing here?

Attached is a picture of what I copied in for the Target on Katalon Recorder, as well as a picture of what the Dev Tools showed for me for the element I’m trying to verify.

wrong: background-color

right: backgroundColor

background-color” is recognised as “background - (minus) color”.

So an exception: “color is not defined” is thrown.

getComputedStyle().backgroundColor, instead of getComputedStyle().background-color will get you the value of the background-color of the element.

Also, getComputedStyle().backgroundColor will return the rgb value of the color. You might want to consider either converting the returned value to hexadecimal, or you can find the rgb value of the expected background-color. (eg. rgb for “b6b1a0”)

Thank you! By correcting it to “backgroundColor” and then echoing my variable, I was able to get the rgb value of the hexadecimal value, then change my assertEval to look for that rgb value! Worked great!!