This question might come of as silly because of my lack of knowledge, but I'm struggling to understand how do I use document.querySelector for identical shadow doms.
Let's say we have 2 shadowDoms that are identical, visible at the same time and you can interact with both.
To perform clicks and what not using testcafe, I use something like:
private shadowDomSelector = Selector(() => document.querySelector('myShadowDom').shadowRoot)
private myShadowDomElement = this.shadowDomSelector.find('input.flex-auto.rounded-full')
await t.typeText(this.myShadowDomElement, 'Test1')
This works, but how do I make the following work?:
private secondShadowDomSelector = Selector(() => document.querySelector('myShadowDom').shadowRoot)
private myShadowDomElement = this.secondShadowDomSelector.find('input.flex-auto.rounded-full')
I tried private secondShadowDomSelector = Selector(() => document.querySelector('myShadowDom').shadowRoot).nth(1)
or private myShadowDomElement = this.ShadowDomSelector.find('input.flex-auto.rounded-full').nth(1)
Please point me in the right direction. Thank you.