API …
Web elements

Shadow DOM

Open, nested and closed shadow roots — and what your locator engine can (and cannot) reach.

Practice tasks

  • Fill the input inside the open shadow root (Playwright pierces it by default).
  • In Selenium use getShadowRoot() and then find the elements.
  • Reach the card nested inside another shadow root.
  • Explain why the closed shadow root cannot be automated through the DOM.

More Web elements practice