Retrieve the computed value of the given CSS property of the given element.

The CSS property to query should be specified using the CSS property name, not the JavaScript property name (e.g. background-color instead of backgroundColor).

Please note that this command operates on a protocol level and accepts the Web Element ID as the parameter. To retrieve it, use either the .findElement() or .findElements() command. Read more on Element retrieval.

Usage

Parameters

Name Type description
webElementId string

The Web Element ID of the element to route the command to.

cssPropertyName string
callback function

Callback function which is called with the result value.

W3C WebDriver spec