I understand this might be a repeated question as I have seen some similar issues and solutions already provided. However, none of the tricks are working for me. Please if you can suggest how do I capture the highlight box in the below HTML - that would be helpful. Thanks in Advance.
IWebElement root = VU.Find(By.CssSelector("wc-doc"));
Pause(5000);
IWebElement Shadowroot1 = VU.getShadowRootElement(root);
Pause(5000);
IWebElement elem1 = Shadowroot1.FindElement(By.CssSelector("wc-spread"));
Pause(5000);
public IWebElement getShadowRootElement(IWebElement element)
{
IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
IWebElement temp = (IWebElement)(js.ExecuteScript("arguments[0].shadowRoot", element));
return temp;
}
The above method getShadowRootElement() is in a Library.