Vitaly
(Vitaly)
28 March 2025 16:11
1
Hi! I want to check background color in different browsers.
I have a next code:
${bg color} Call Method ${elements} value_of_css_property background-color
The problem is:
I get result in RGB in FireFox, but in chrome I’ve got result RGBa. Why did I get different formats for the same method? I’ve double checked in chrome element have RGB.
Hi,
I think the answer might be there:
opened 06:10AM - 04 Oct 19 UTC
Get Element CSS Value
needs-discussion
Guys, I'm getting the following in my selenium test:
> expected: <rgb(255, 0,… 0)> but was: <rgba(255, 0, 0, 1)>
The issue is that I get different result when our tests is executed on our CI or locally. In both cases our app is running in a docker container and the browser and selenium "proxy" is also running in a docker container so that should be the same. What is different is the test itself (ie the selenium client side): locally it's running directly on the OS (macosx for me) and on the CI it's running inside a docker container (debian).
Locally I get `rgb(255, 0, 0)` and in the CI we get `rgba(255, 0, 0, 1)`.
Note: we use `WebElement#getCSSValue()` to return the value.
Any idea? Thanks
Chromedriver returns RGBa, so best solution would be to manage differently the result depending of the browser, or use a Regex.
See this:
Regards
Charlie