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