I attempted something that worked in the Console but not on Selenium IDE:
Retrieve the color of the box with the ID "box10"
Execute: getComputedStyle(document.querySelector("#box10")).backgroundColor
Extract the text from the a.innerText within the box identified as "box10"
3.Compare the values
However, there was an issue:
Assertion on background.color with value ${box.color.a} Failed:
The actual value 'rgb(0, 0, 255)' did not match '#0000ff'
The command getComputedStyle(document.querySelector("#box10")).backgroundColor will provide the RGB value
I tried converting it using the following code:
const rgb2hex = (rgb) => `#${rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/).slice(1).map(n => parseInt(n, 10).toString(16).padStart(2, '0')).join('')}`; rgb2hex(getComputedStyle(document.querySelector("#box10")).backgroundColor)
It successfully executed in the console, but it doesn't function with the Execute script command in Selenium IDE; I don't have much time to investigate further, but hopefully, it's a good starting point. Let me know if you discover anything!
IDE: