Verify an element's colour (Java)
QuizMediumJava onlyAsked in: Accenture, Infosys
A span is styled color: red. In Chrome, what does span.getCssValue("color") return, and how do you compare it with #ff0000?
rgba(255, 0, 0, 1); convert withColor.fromString(value).asHex()and compare with#ff0000red, exactly as written in the style#ff0000directly- It throws, because colours need JavaScript
This question is part of Pro+
Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.