0

I want to read the date value inside this shadow root.

Image1

even though I tried below it says 'no such shadow root'. How can I correct this?

driver.FindElement(CustomTimeHours).GetShadowRoot().FindElement(By.Id("placeholder")).Text
eng
  • 443
  • 1
  • 4
  • 10
  • Read this post if it helps: https://stackoverflow.com/questions/55761810/how-to-automate-shadow-dom-elements-using-selenium – Rumplin Jul 18 '23 at 05:58
  • Can you give it a try : date_value = driver.execute_script('return arguments[0].shadowRoot.getElementById("placeholder").innerText;', custom_time_hours) – Samira Kumar Nanda Jul 18 '23 at 08:55
  • 1
    Does this answer your question? [How to automate shadow DOM elements using selenium?](https://stackoverflow.com/questions/55761810/how-to-automate-shadow-dom-elements-using-selenium) – srn Jul 18 '23 at 09:00

0 Answers0