WebDriver element.text returning lowercase, when css uppercase applied

Confirmed Issue #11322543 • Assigned to Arthur B.

Details

Created
Mar 18, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Standard affected
WebDriver

Reports
Reported by 2 people

Sign in to watch or report this issue.

Steps to reproduce

Create a webpage with an element that has a css style of text-transform: uppercase.

text

(note was trying to give div code, this is rendering in preview properly but not on the issue page)

#myelement {
    text-transform: uppercase;
}

Run a test that checks the .text of the element. For example, with python selenium bindings:

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.Edge()
driver.get("http://yoursite.com")
element = WebDriverWait(driver, 10).until(
    EC.text_to_be_present_in_element(
        (By.ID, "myelement"), 'TEXT'
    )
)

In Chrome, Firefox, Safari, and IE this test will pass. But in Edge it will fail as the element.text returns as "text". Whilst that is the dom value, it is not the displayed value. I’m not sure what the standard says about this, but the inconsistent implementation compared to other browsers, including internet explorer, makes cross-browser testing harder.


Update: I took a quick look at the standard: https://www.w3.org/TR/webdriver/#get-element-text and it says

The Get Element Text command intends to return an element’s text “as rendered”.

Therefore, I believe that this is a bug and the other browser implementations are returning the correct value.

Attachments

0 attachments

    Comments and activity

    • Changed Steps to Reproduce

      Changed Steps to Reproduce

      Changed Steps to Reproduce

      Changed Steps to Reproduce

      Changed Steps to Reproduce

    • Microsoft Edge Team

      Changed Assigned To to “Steven K.”

      Changed Assigned To to “Mike J.”

      Changed Assigned To from “Mike J.” to “John J.”

      Changed Assigned To from “John J.” to “Stanley H.”

      Changed Status to “Confirmed”

      Changed Assigned To from “Stanley H.” to “Sanket J.”

      Changed Assigned To from “Sanket J.” to “Sanket J.”

      Changed Status from “Confirmed”

      Changed Status to “Confirmed”

      Changed Assigned To from “Sanket J.” to “Arthur B.”

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

    Sign in