GetComputedStyleValue() does not work in FireFox

2 posts, 0 answers
  1. Toldo
    Toldo avatar
    4 posts
    Member since:
    Jul 2012

    Posted 29 Aug 2012 Link to this post

    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):
    string style = new HtmlControl(element).GetComputedStyleValue("font-family");
    I have managed to proceed with workaround in JS, but it looks like something wrong with plugin in latest FF browser versions.

    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.


  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 03 Sep 2012 Link to this post

    Hello Toldo,

    Thank you for reporting the issue. I was able to reproduce it and logged it as a bug. You can track its progress in our PITS system here: Public URL.

    I've updated your Telerik Points accordingly.   

    Regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top