Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

How should I extract Shadow DOM using synthetic


#1

I am creating a script where I have to access email & password field which is getting rendered using shadowdom


#2

@Harshil.Maradiya -

I’m not very familiar with ShadowDom - can you still find a locator for those elements in the browser console?

I typically right click elements, click inspect, and from there I copy the xpath to use in Synthetics. I assume that ShadowDom would still allow for element locators?


#3

Hey, thanks for the response. I first tried that but did not work.

ShadowDom is nothing but the webcomponent present on the page but I think they are not part of the DOM.


#4

@Harshil.Maradiya - Understood!!

So it looks like this may not be possible natively with webdriver, but could be done with executeScript, as detailed in a few links my colleague shared here:

Let me know if that helps