Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

294
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda