Verify Background Color of Button

I already wrote a similar question to this back in May - Verify Background Color of Element - #2 by kazurayam

I now need to verify the color of a button, but I’m not sure which part of the class I should be copying. According to the older page, I should be copying Selector, but that is not working. Here is the button and the element I am trying to copy -

But when I copy the selector (the “button” information highlighted in blue on the right), all it returns is #formulaDispense and that is not working for storing the background color information -

Is there some other part of the button element/class I should be copying to verify the background color of the button?

I finally figured it out on my own - this time, instead of using “Copy Selector”, which did not work, this time, it instead worked with “Copy JS Path” - which is document.querySelector(“#formulaDispense”). Don’t know why Selector worked on the previous issue, but JS Path works here.

1 Like

Hi @eric.oswald, thank you for sharing this our community. Your solution will definitely help others save some time. Cheers!