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

297
Views
Shadow DOM: no se puede hacer clic en el elemento (Selenium webdriver nodejs)

Estoy intentando hacer clic en un elemento en un shadow dom. Estoy usando Selenium Webdriver JS. Actualmente tengo acceso a la raíz de la sombra. También puedo encontrar un elemento. Así que pensé que hacer clic en el último bit sería sencillo, pero no puedo averiguar cómo. No hay mucho soporte para Shadow Dom con js.

Line await element.click() es el código infractor. Pero no puedo averiguar cómo hacer clic en ese elemento.

 // 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!