Is there a way to parameterize Shadow Object

I’ve given Shadow object’s css as “#${num}”
i am trying to get the data of object (div > div:nth-child(1) > div:nth-child(2)) i.e… 2016 in below screenshot…
now how do i pass the value to the variable “num” in shadow object.

1q1q.PNG

By following with this guide: http://docs.katalon.com/display/KD/Parameterized+a+Test+Object, you can apply the same approach to shadow DOM object. Actually, shadow DOM object is treated as a normal object, so you can parameterize it.

Vinh Nguyen said:

By following with this guide: http://docs.katalon.com/display/KD/Parameterized+a+Test+Object, you can apply the same approach to shadow DOM object. Actually, shadow DOM object is treated as a normal object, so you can parameterize it.

I understood this approach.
In the above screenshot…
i want text of


WebUI.getText(findTestObject(‘DetailsCalendarYear’) _ // i.e… 2016
_
The Shadow Root Parent of the above test object was parameterized // _i.e… ${num}
_But how to pass value to this variable(num) as we are not calling/using this shadow test object in the script.

saish said:

Vinh Nguyen said:

By following with this guide: http://docs.katalon.com/display/KD/Parameterized+a+Test+Object, you can apply the same approach to shadow DOM object. Actually, shadow DOM object is treated as a normal object, so you can parameterize it.

I understood this approach.
In the above screenshot…
i want text of


WebUI.getText(findTestObject(‘DetailsCalendarYear’) _ // i.e… 2016
_
The Shadow Root Parent of the above test object was parameterized // _i.e… ${num}
_But how to pass value to this variable(num) as we are not calling/using this shadow test object in the script.

I had the similar issue, where my iframe is a parent object of another button object.
I could not parameterized the parent object.
There’s no way for me to insert the value into the iframe object during runtime.

I am able to resolve this issue…

In the above mentioned scenario, the ID for shadowRootParent object is dynamic…
If we want to perform some actions on its child object, the concept of parameterizing the parent object and passing the parameter from its child object will not work…

So, for the ShadowRootParent : properties , instead of using Id or CSS i have given “tag” property to identify the object…
It worked :slight_smile:

Note: Some objects might have few dynamic properties for which we need to use parameterization concept. If this doesn’t work, we can use combination of static properties to identify the test object. We can also try using different conditions for the properties.