Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix: add missing await in adoptIfNeeded (#32497)

Yury Semikhatsky11441c0fe140
diff --git a/packages/playwright-core/src/server/frameSelectors.ts b/packages/playwright-core/src/server/frameSelectors.ts
index 66f2e2e514..4be2a9c285 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<T extends Node>(handle: ElementHandle<T>, context: FrameExecutionContext): Promise<ElementHandle<T>> {
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;
}