WebDriver /css command doesn't return computed style

Not reproducible Issue #7463910

Details

Author
Jason C.
Created
May 6, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
14.14316
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Create a test page with a styled element:

<style>a { background: purple; }</style>
<a id="a1">foo</a>

Request the element’s “backgroundColor” property with "[element]/css/backgrounColor". The WebDriver returns a value of "", whereas calling window.getComputedStyle(document.getElementById('a1')).backgroundColor returns "rgb(128, 0, 128)", which is the expected value (the /css command is expected to return the computed values of CSS properties).

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Ibrahim O.”

    • Thank you for your feedback. Could you please send us your actual code that you are referring as "[element]/css/backgrounColor". This will help our investigation.

      Best regards,
      The MS Edge Team

    • I’m using the Leadfoot WebDriver library (https://github.com/theintern/leadfoot) to retrieve an element reference and then call getComputedStyle. The getComputedStyle call ends up making a POST to:

      http://[selenium_server:port]/wd/hub/session/[session_id]/element/[element_id]/css/backgroundColor
      
    • Thank you for the update. To able to minimize the repro could you please also confirm your test result in case of using background-color property instead of background.

      Best regards,
      The MS Edge Team 

    • Sorry for taking so long to get back to you on this. I’m now using Edge build 14366 and the most current insider MicrosoftWebDriver with Selenium 2.53.1. I’ve tried all combinations of specifying “background” and “background-color” in the CSS and requesting “background” and “backgroundColor” via WebDriver. In all cases, Edge returns an empty response.

    • Microsoft Edge Team

      Changed Title from “WebDriver /css command doesn't return computed style” to “WebDriver /css command doesn't return computed style”

      Changed Assigned To to “Mara P.”

    • Ok, after testing this a bit more, I can get Edge to return styles. My problem was that I was using a camel case name (“backgroundColor”), but Edge appears to only understand hyphenated names (“background-color”). It took me a while to try this because I’ve always used camel case names with the other browsers (IE, Chrome, Firefox).

    • Thank you for the update.  

      All the best,
      The MS Edge Team

    • Microsoft Edge Team

      Changed Status to “Not reproducible”

    • We are not able to repro this in builds 14910.1003 using Webdriver 14366. Thank you for your feedback.

      All the best,
      The MS Edge Team

    You need to sign in to your Microsoft account to add a comment.

    Sign in