Skip to content

Consider using visible text for text #56

@beatngu13

Description

@beatngu13

Text (key text) is currently extracted via nodeValue (see getText), i.e., the node's actual text value. The problem is that the text might be displayed differently, for example, if a certain text-transform is applied. So when a node's text is "foo", this could be displayed as "Foo", "FOO", …

The WebDriver link text locator retrieves the rendered text via the Get Element Text command:

Let rendered text be the result of performing implementation-specific steps whose result is exactly the same as the result of a Call(bot.dom.getVisibleText, null, element).

We might want to consider to do this is as well, but:

  1. Is dom.js available in the browser? If yes, in any browser? If no, do we have to bundle the script since we don't want to reimplement the functionality?
  2. What do we do with redundant information such as text-transform, which is then reflected in the rendered text?
  3. How can this be properly tested?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions