1

I am trying to grab and click on a button with New Relic's synthetic scripted browser test utility but the element I'm trying to find is under a #shadow-root in the DOM. Node script looks like:

$browser.get('https://www.null.com').then(() => {
    return $browser.waitForAndFindElement($driver.By.className('btn'), 10000).click();
}):

But it errors out with:

Check failed with task timed out. Error: task timed-out waiting for element to be located using:By(css selector, .btn)

I'm asking to see if there is a work around for grabbing elements in the shadow DOM to be able to use with the selenium webdriver.

JeromeCode
  • 117
  • 9
  • I have also increased the wait time to 60 secs and have received the same results. – JeromeCode Mar 22 '22 at 17:39
  • Did you check https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/scripting-monitors/synthetic-scripted-browser-reference-monitor-versions-chrome-100/#shadow ? – MaicolBen Jul 13 '23 at 13:20

0 Answers0