Robotic Process Automation (RPA)

Robotic Process Automation (RPA)

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

 View Only
  • 1.  Automate a website which uses Shadow DOM

    Posted Mon March 14, 2022 12:43 PM
    Hi

    does anyone has any experience in using IBM RPA against a website which heavily uses Shadow DOM (for instance sites which are build with Nuxeo CMS)?
    I am not a web developer and to be honest, I heard about Shadow DOM for the first time today.
    It seems to be a technique to encapsulate some functionalities used in web application but as a result these components do not have a "normal" selector which can be used while automating.
    For the moment I am stuck so I am hoping that there is someone who has some tips&tricks and can point me to the right direction.
    Thanks in advance,

    ------------------------------
    nordine vandezande
    ------------------------------


  • 2.  RE: Automate a website which uses Shadow DOM

    Posted Tue March 15, 2022 04:26 AM
    Hi Nordine!

    Can you add an example of an url and what elements you are trying to access? I'm not sure I've heard about this technique before but I've worked a lot with RPA and have come across some other dynamic frameworks.

    ------------------------------
    David Fredriksson
    ------------------------------



  • 3.  RE: Automate a website which uses Shadow DOM

    Posted Tue March 15, 2022 06:20 AM
    Hi David

    thanks for your interest.
    The web app that I need to automate is not publicly accessible but I found a website with similar Shadow DOM object, cfr https://books-pwakit.appspot.com/explore

    I am unable to wait for an element or to set a value to the Search field. I have tried selectors based on full Xpath, CSS, ...

    defVar --name bElementExists --type Boolean
    webStart --name TEST --type "Chrome"
    webNavigate --url "https://books-pwakit.appspot.com/explore"
    webWaitElement --selector "XPath" --xpath "/html/body/book-app//app-header/app-toolbar[2]" bElementExists=value
    logMessage --message "Element exists: ${bElementExists}" --type "Info"
    webSet --value hello --selector "CssSelector" --css "#input" --simulatehuman
    webClose --name TEST --leavebrowseropen​


    ------------------------------
    nordine vandezande
    ------------------------------



  • 4.  RE: Automate a website which uses Shadow DOM

    Posted Tue March 15, 2022 06:52 AM
    I can see why elements are not picked up by the tool. Normal xpath's don't apply here.

    Try a "Run JavaScript" activity and script you actions using lines like:
    document.querySelector('book-app').shadowRoot.querySelector('#input').value=''...'

    (I only tested it in chrome, not in the Studio)

    I think it's either that, image recognition, or sending keystrokes.

    ------------------------------
    David Fredriksson
    ------------------------------



  • 5.  RE: Automate a website which uses Shadow DOM

    Posted Wed March 16, 2022 05:29 AM
    Hi David

    thanks again for your response.
    Although the "Run Javascript"-option seems to work for setting an input value, I am still unable to actually search for books (in the book app example). I will investigate it further but it will be hard to use this technique for the automation I need to do because that involves different kinds of components (checkboxes, dropdow lists, tables, ...)

    ------------------------------
    nordine vandezande
    ------------------------------



  • 6.  RE: Automate a website which uses Shadow DOM

    Posted Wed March 16, 2022 05:30 AM
    Ok, good luck!

    Please add a comment here later on if you find a better solution.





  • 7.  RE: Automate a website which uses Shadow DOM

    Posted Fri March 25, 2022 02:53 PM
    Hi Nordine! Try this.. (Your computer must be ate 1920 x 1080p resolution, windows zoom must be at 100% and Google Chrome zoom at 100% )

    webStart --name TEST --type "Chrome"
    webNavigate --url "https://books-pwakit.appspot.com/explore"
    webWait
    mouse --mode "Click" --resolution "Absolute" --point "933,541"
    sendKeys --keys teste
    keyboard --type "KeyPress" --key "Return"
    keyboard --type "KeyUp" --key "Return"
    webClose --name TEST --leavebrowseropen


  • 8.  RE: Automate a website which uses Shadow DOM

    Posted Mon March 28, 2022 03:57 AM
    Hi Filipe

    Thanks for your response.
    The appspot.com URL is just an example of a website which uses ShadowDOM. I used this example to demonstrate that IBM RPA is not able to use a selector in that case. Or at least, I don't know how I can make IBM RPA use a selector.
    For the actual application that I need to automate, surface automation (using keystrokes, mouse clicks or image recognition) is not an option because the navigation is quite complication (dynamic dropdown list, checkboxes) and involves interpreting a table.

    ------------------------------
    nordine vandezande
    ------------------------------



  • 9.  RE: Automate a website which uses Shadow DOM

    Posted Thu May 12, 2022 07:24 AM
    Unfortunately, IBM RPA does not support shadow dom. Please raise an idea for it: https://dba.ideas.ibm.com/ideas?project=WDGRPA

    ------------------------------
    Joba Diniz
    Product Manager
    IBM
    ------------------------------