diff --git a/PuppeteerLibrary/playwright/custom_elements/playwright_page.py b/PuppeteerLibrary/playwright/custom_elements/playwright_page.py index b4b74bd..a2f8844 100644 --- a/PuppeteerLibrary/playwright/custom_elements/playwright_page.py +++ b/PuppeteerLibrary/playwright/custom_elements/playwright_page.py @@ -78,10 +78,16 @@ async def waitForSelector_with_selenium_locator(self, selenium_locator: str, tim options['state'] = 'hidden' selector_value = SelectorAbstraction.get_selector(selenium_locator) - return await self.get_page().wait_for_selector( - selector=selector_value, - timeout=options['timeout'], - state=options['state']) + if self.selected_iframe is not None: + return await self.selected_iframe.wait_for_selector( + selector=selector_value, + timeout=options['timeout'], + state=options['state']) + else: + return await self.get_page().wait_for_selector( + selector=selector_value, + timeout=options['timeout'], + state=options['state']) ############ # Query