public WebElement retrieveShadowRootElement(WebElement element) {
WebElement shadowRoot = (WebElement) ((JavascriptExecutor)driver)
.executeScript("return arguments[0].shadowRoot", element);
return shadowRoot;
}
WebElement rootElement= driver.findElement(By.xpath("(//div[@id='accordionSearch']//descendant::input[@class='form-control'])[1]"));
WebElement shadowRootElement= retrieveShadowRootElement(rootElement);
WebElement targetElement= shadowRootElement.findElement(By.cssSelector("div[id=editing-view-port]/div"));
targetElement.click();
Encountering issues with the code above.
https://i.sstatic.net/jf6nA.png https://i.sstatic.net/Sqwx8.png