Interview Questions

Selenium WebDriver - How to retrieve css properties of an element?

Selenium WebDriver Interview question and Answers


(Continued from previous question...)

Selenium WebDriver - How to retrieve css properties of an element?

The values of the css properties can be retrieved using a get() method:
Syntax:
driver.findElement(By.id(“id“)).getCssValue(“name of css attribute”);
driver.findElement(By.id(“id“)).getCssValue(“font-size”);

(Continued on next question...)

Other Interview Questions