• Just inspect the element if it will be inside shadowDOM, it will show “in ShadowDOM” in the SelectorsHub tab.
  • It will auto generate the script in java-selenium to automate shadow dom element
  • It will also generate the css selector and gives other information.
  • To write the cssSelector for any element which is inside shadowDOM, just inspect that element and start typing.
  • To verify any cssSelector inside a shadowDOM, first inspect any element inside that shadowDOM in which you want to verify your cssSelector
  • Note: shadowDOM supports only cssSelectors and it doesn’t support xpath.
  • You can watch the below mentioned video to learn more about it with practical live example: