I want to check the color of an element in an html page. The color of this element is set with a javascript, look at the image
The element with div-id \"Ab_banco_M
Try below code
public String ColorVerify(String cssSelector, String cssValue)
{
/* This method used to verify color code*/
WebElement target = driver.findElement(By.cssSelector(cssSelector));
String colorCode= target.getCssValue(cssValue);
String hexacolor = Color.fromString(colorCode).asHex();
return hexacolor;
}