Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

293
Views
Shadow DOM - Unable to Click element (Selenium webdriver nodejs)

I am attempting to click an element in a shadow dom. I am using Selenium Webdriver JS. I currently get access the shadow root. I also can find an element. So I thought the last bit clicking it would be straight forward but cant find out how. There is not much support for Shadow Dom with js.

Line await element.click() is the offending code. But cant work out how to click that element.

// This gets the shadow Root
async function getShadowRoot() {
    let shadowHost;
    await (shadowHost = await driver.wait(until.elementLocated(By.css("body > div.project > sn-component-va-web-client"))),5000);
    return driver.executeScript("return arguments[0].shadowRoot", shadowHost);   
};              
       
//This find element inside the shadow Dom.     
async function findShadowDomElement() {
    let shadowRoot;
    let element;
    await (shadowRoot = getShadowRoot());
    await shadowRoot.then(async (result) => {  
    await (element = result.findElement(By.css("div.menu-item.contact-support-clicker")));    
    await element.click()
    });                         
    return element
}                
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!