Q: Do we have to use JSPath along with Shadow DOM? Isn’t it possible to use XPath or CSS locators for that?
A: Not directly. XPath and CSS selectors are designed to select elements from the main document tree, and they cannot directly access elements that are contained within shadow DOM trees.
Q: What is the difference between the “click” and “enhancedClick” methods? I am more interested to know about the “enhancedClick” method. Thanks!
A: Hi Naveen, enhanceClick is using JavaScript executor which is much more powerful than WebUI.click.
Q: In my case, the Shadow DOM elements are present inside an iframe. I saw in the video we used JS Path to click the element, so switch to frame and directly using the javascript click method will allows the click to happen? Or do we need to create an object for iframe and need to create a child object and link to it to click. Please advise.
A: In this case, yes we need to switch to iframe first before clicking on the Shadow DOM elements.