Skip to content

re-opening issue regarding shadowDOM access #15734

@dornech

Description

@dornech

Sorry, with all due respect for your efforts @titusfortner I slightly disagree there is no issue regarding shadowDOM access.

While the code works (also when I use CSS_SELECTOR access) the issue remain that old code does not work. So there is at least a regression issue.

As mentioned, the issue is that the Python shadowroot object has no attribute/properties "id" set.
This is strange to the extent that Python webelement has both attributes/properties i. e. id and _id set or deifned as property funktion.
Moreover: manually setting "id = _id" solves the problem and makes old code work.

After looking into webelement.py and finding this

    @property
    def id(self) -> str:
        return self._id

I do not think anymore it is an issue related to evaluation webdriver response but a missing property in the shadow-root class in the same way as defined for webelement.

This is the recommended way to interact with Shadow DOM content. I've verified it works.

    driver = webdriver.Chrome()
    driver.get("https://www.consorsbank.de/home")

    shadow_host = driver.find_element(By.TAG_NAME, 'wb-website-header')
    shadow_root = shadow_host.shadow_root
    shadow_content = shadow_root.find_element(By.ID, 'wemo_theme')

Originally posted by @titusfortner in #15732

Metadata

Metadata

Assignees

No one assigned

    Labels

    G-chromedriverRequires fixes in ChromeDriverG-w3cRequires change to W3C Spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions