Hello!!
I am not an expert programmer so I am struggling here. I would really appreciate a bit of a help!
I am trying to figure out how to get or at least verify that a value in this case â8â is inside the div for this shadow root. As far as I understand for now, the logic is similar to an iframe. I have to tell Katalon which is the parent container so that it knows where to look for the shadow root.
I am not being able to make it. Here is how it looks
So I created a test objec called Nitrogen Yield with the following xpath:
//input[@id=ânitrogen-yieldâ]
Then I created another test object called Shadow value, with the following xpath : //div[contains(text(),â8â)] and the previous object called Nitrogen Yield as âShadow Root Parentâ
But when I run a Verify element present on âShadow valueâ object, I get as message:
âTestObject - âObject Repositor/xxxxx/Nitrogen yieldââ is not a shadow root element)
Could someone please explain me how I can verify the 8?
var container = document.querySelector(â#exampleâ);
//Create shadow root !
var root = container.createShadowRoot();
root.innerHTML = â
Root
Element in shadow
â;
//Access the element inside the shadow !
//âcontainer.shadowRootâ represents the youngest shadow root that is hosted on the element !
console.log(container.shadowRoot.querySelector(".test").innerHTML);
I define a shadow parent like: (//main[contains(@class,âDetailedâ)]//div[@class=âhtmlTemplateâ])[1]
and the shadow object which I need to verify with property like xpath as you see on picture below