Robotic Process Automation (RPA)

Robotic Process Automation (RPA)

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  How do I bypass a Nested Shadow DOM (Shadow Root) in RPA?

    Posted Thu September 25, 2025 12:13 PM

    Hi,

    I know that when dealing with shadow DOM, you need to use the command, "Run JavaScript"  however this only works with a single shadow root. When there is a nested shadow root this command no longer works, is there another way on RPA to bypass this nested shadow root?



    ------------------------------
    Mike Ortiz
    ------------------------------


  • 2.  RE: How do I bypass a Nested Shadow DOM (Shadow Root) in RPA?

    Posted Fri November 14, 2025 09:26 AM

    We do not natively support Shadow DOM. 
    However, with the "Run JavaScript" command, you can easily access any element and perform the necessary actions directly using JavaScript.

    We have a blog with an example of how to do it.
    If it still doesn't work, I need more details to understand your scenario.



    ------------------------------
    Tarcio Alonso Mota
    Sr. Software Developer
    IBM
    Santos
    ------------------------------



  • 3.  RE: How do I bypass a Nested Shadow DOM (Shadow Root) in RPA?

    Posted 28 days ago

    And to add to Tarcisio's answer, in your case, where they are nested, you just have to repeat the process using the same strategy, like this:

    document
      .querySelector("outer-component")
      .shadowRoot.querySelector("inner-component")
      .shadowRoot.querySelector("input[name='username']");


    ------------------------------
    Vinicius Marques
    Data Engineer
    Music.AI
    Rio Grande
    ------------------------------