getCSSProperty
Get a css property from a DOM-element selected by given selector. The return value is formatted to be testable. Colors gets parsed via rgb2hex and all other properties get parsed via css-value.
தகவல்
Note that shorthand CSS properties (e.g. background
, font
, border
, margin
,
padding
, list-style
, outline
, pause
, cue
) will be expanded to fetch all longhand
properties resulting in multiple WebDriver calls. If you are interested in a specific
longhand property it is recommended to query for that instead.
Usage
$(selector).getCSSProperty(cssProperty, pseudoElement)
Parameters
Name | Type | Details |
---|---|---|
cssProperty | string | css property name |
pseudoElement | PseudoElement | css pseudo element |
Examples
example.html
<label id="myLabel" for="input" style="color: #0088cc; font-family: helvetica, arial, freesans, clean, sans-serif, width: 100px">Some Label</label>