[w3c/webcomponents] Shadow DOM Support in Chrome WebDriver for testability of Google Polymer Web Components (#837)

Our application is built with Google Polymer 0.5 Web Components. In most of the pages, we are having Shadow DOMs. Multi-level Shadow DOMs are also available in many pages. Depth of the Shadow DOM is from 5 to 8 levels. Now we are trying to set up end-to-end automation testing for this Google Polymer application. We are using the latest version of Selenium Chrome Webdriver (Chrome browser / webdriver version 76.0 as on Sept 11th 2019) to automatically test the Google Polymer web pages. But Selenium Chrome Webdriver is unable to simulate mouse click events especially on the web elements that are residing within multi-level nested Shadow DOMs. Selenium Chrome Webdriver is able to simulate mouse click events on web elements that are residing in the Shadow DOM with a depth of 1 or 2 levels. But further down the level (For instance :- web element residing in 5th level Shadow DOM), Selenium Chrome Webdriver is able to locate the elements but unable to trigger simulated mouse click events on the web elements available within multi-level nested Shadow DOMs. While attempting to trigger simulated mouse click events on web elements residing within multi-level nested Shadow DOMs, "Move Target Out Of Bounds" exception is thrown at run time. This exception is usually thrown when the specific element is out of browser view port. But this element (which is a Google Polymer "core-icon" component) is in the browser view port and also clearly viewable in the page. Googling confirmed that Shadow DOM support is not provided by Selenium Chrome Webdriver. Workaround specified in some of the forums "document.querySelector('selector').shadowRoot" did not work as expected, as this Google Polymer panel (which contains the "core-icon" component) is dynamically injected at run time. So executing "document.querySelector('panelSelector').shadowRoot.querySelector('coreIconPanel')" in Chrome browser console is returning null. Since this became a major showstopper in setting up our end-to-end automation testing, please provide details on when the Shadow DOM Support will be added in Chrome Webdriver for the testability of Google Polymer Web Components. So far we have tried the following tools / combinations and this issue is occurring in all the combinations 1) Selenium 2) TestNG + Selenium 3) Robot + Selenium 4) Protractor + Selenium

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/837

Received on Wednesday, 11 September 2019 04:16:01 UTC