Skip to content

[🐛 Bug]: "Get Text" atom ignores slot value for web component without custom text #13206

Description

@whimboo

What happened?

The Selenium atom Get Text should not only return the value from a slot when it is used but also it's default value when it has not been used. In the example below the value foobar is visible as text but the atom Get Text returns just bar.

How can we reproduce the issue?

With the following testcase it can be reproduced:


    <head>
      <script>
        class TestContainer extends HTMLElement {
          connectedCallback() {
            this.attachShadow({ mode: 'open' });
            this.shadowRoot.innerHTML = `<slot><span>foo</span></slot>bar`;
          }
        }

        customElements.define('test-container', TestContainer);
      </script>
    </head>

    <body>
      <test-container></test-container>
    </body>

CC @43081j in case you are interested.



### Relevant log output

```shell
No log output available.

Operating System

MacOS 13.6

Selenium version

Latest

What are the browser(s) and version(s) where you see this issue?

Firefox (not tested with others)

What are the browser driver(s) and version(s) where you see this issue?

geckodriver (not tested with others)

Are you using Selenium Grid?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-atomsJavaScript chunks generated by Google closureI-defectSomething is not working as intendedR-awaiting mergePR depends on another PR for merging

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions