diff --git a/packages/playwright-core/src/server/frameSelectors.ts b/packages/playwright-core/src/server/frameSelectors.ts index 66f2e2e514382..4be2a9c2853df 100644 --- a/packages/playwright-core/src/server/frameSelectors.ts +++ b/packages/playwright-core/src/server/frameSelectors.ts @@ -160,7 +160,7 @@ export class FrameSelectors { async function adoptIfNeeded(handle: ElementHandle, context: FrameExecutionContext): Promise> { if (handle._context === context) return handle; - const adopted = handle._page._delegate.adoptElementHandle(handle, context); + const adopted = await handle._page._delegate.adoptElementHandle(handle, context); handle.dispose(); return adopted; }