Need to automate by interacting with shadow dow, how can i get such element so i can click on that ???
We can not automate this type of element directly via driver.findElement, because multiple shadow roots available in the node amplify-authenticator.
So here we can automate with help of CSS selector (XPath not working here)
Open the console, write the -
document.querySelector(‘amplify-authenticator’) (Here if Shadow root is not open like close then we can automate with help of WebdriverIO)
here cover the all executeScript root via query selector
Then write the code in our class-
WebElement clearData = (WebElement) jse.executeScript(“paste here executeScrpte”);
String js = “argument.setAttribute(‘value’, ‘what you want to send’)”;