Hello,
When I am using next code to get computed CSS style value it works in every browser except FireFox (v.14.0.1 and v.15.0):
I have managed to proceed with workaround in JS, but it looks like something wrong with plugin in latest FF browser versions.
The exception thrown listed below:
ArtOfTest.WebAii.Exceptions.ExecuteCommandException was unhandled by user code
Message=ExecuteCommand failed!
InError set by the client. Client Error:
mozCommandProcessor: ReferenceError: family is not defined
BrowserCommand (Type:'Information',Info:'ComputedStyle',Action:'NotSet',Target:'ElementId (tagName: 'div',occurrenceIndex: '11')',Data:'font-family',ClientId:'226bfc0e-c75f-4d6d-8837-eed994cd46c2',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'mozCommandProcessor: ReferenceError: family is not defined')
InnerException: none.
When I am using next code to get computed CSS style value it works in every browser except FireFox (v.14.0.1 and v.15.0):
string
style =
new
HtmlControl(element).GetComputedStyleValue(
"font-family"
);
string
script = @
"function getstyle() {var el = document.getElementById('"
+ element.IdAttributeValue +
"');"
+
"var computedStyles = window.getComputedStyle(el, null);\n"
+
"return computedStyles.getPropertyValue('font-family')}\n getstyle()"
;
style = Actions.InvokeScript<
string
>(script);
The exception thrown listed below:
ArtOfTest.WebAii.Exceptions.ExecuteCommandException was unhandled by user code
Message=ExecuteCommand failed!
InError set by the client. Client Error:
mozCommandProcessor: ReferenceError: family is not defined
BrowserCommand (Type:'Information',Info:'ComputedStyle',Action:'NotSet',Target:'ElementId (tagName: 'div',occurrenceIndex: '11')',Data:'font-family',ClientId:'226bfc0e-c75f-4d6d-8837-eed994cd46c2',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'mozCommandProcessor: ReferenceError: family is not defined')
InnerException: none.