My task is to verify the color of the header on a webpage to ensure it is the correct color (#FFFFFF). The color value is stored in the CSS file. I attempted the following code, but unfortunately, it did not work as expected.
String headerColor = driver.findElement(By.xpath(".//*[@id='title']/h1")).getCssValue("color");
Assert.assertTrue("#000000", sColor.equals("#FFFFFF"));
I need assistance in finding the correct way to achieve this.