Skip to content

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

chore(bidi): mark all `no such frame` errors with type `closed` (#42118)

Holger Benl88410f443a05
diff --git a/packages/playwright-core/src/server/bidi/bidiConnection.ts b/packages/playwright-core/src/server/bidi/bidiConnection.ts
index b38976787b..d15e8df7e8 100644
--- a/packages/playwright-core/src/server/bidi/bidiConnection.ts
+++ b/packages/playwright-core/src/server/bidi/bidiConnection.ts
@@ -248,6 +248,8 @@ export class BidiSession extends EventEmitter {
const callback = this._callbacks.get(object.id)!;
this._callbacks.delete(object.id);
if (object.type === 'error') {
+ if (object.error === 'no such frame')
+ callback.error.type = 'closed';
callback.error.setMessage(object.error + '\nMessage: ' + object.message);
callback.reject(callback.error);
} else if (object.type === 'success') {