I'm using Playwright to do some end to end automation on a web application composed of multiple nested iframes. For now, I decompose the multiple iframes using frameLocator and then I try to locate an element in the desired iframe:
const firstFrame = await page.frameLocator("#firstIframe");
const secondFrame = await firstFrame.frameLocator("#secondIframe");
const element = await secondFrame.locator("input").fill("Some text")
Is there a way to locate an element in any iframe so I don't need to decompose all the nested iframes?