SNow toolbar - How to access Shadow element xpath using selenium Java.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2024 08:29 PM
Description: SNow toolbar - Shadow element xpath access issue using selenium Java.
We've to locate elements from toolbar (e.g., Impersonate User, Clicking on "All" tab) using selenium Java. However, we've observed that there are nested Shadow elements on the page and we're facing issue while identifying the same.
So, could someone please check and help us on how to locate SNow toolbar - Shadow element xpath using selenium Java?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2024 11:18 PM
Hi @samirmantri
To access shadow DOM elements in ServiceNow using Selenium and Java, I think you need to first locate the shadow host element, then use JavaScript execution to retrieve the shadow root, and finally interact with the elements inside it.
Thanks.