codeceptjs / codeceptjs/CodeceptJS

Protocol error (Runtime.callFunctionOn): Argument should belong to the same JavaScript world as target object

Open
#4,460 3 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
JavaScript
Stars
4.2k
Forks
757
Avg merge
2d 9h
Merged PRs (30d)
16

Description

#### What are you trying to achieve?
After update codeceptjs from version 3.6.0 to 3.6.4 and puppeteer from 20.2.0 to 22.14.0 I got error in my tests

#### What do you get instead?
```

Protocol error (Runtime.callFunctionOn): Argument should belong to the same JavaScript world as target object
at Callback. (node_modules/puppeteer/node_modules/puppeteer-core/src/common/CallbackRegistry.ts:114:12)
at new Callback (node_modules/puppeteer/node_modules/puppeteer-core/src/common/CallbackRegistry.ts:119:3)
at CallbackRegistry.create (node_modules/puppeteer/node_modules/puppeteer-core/src/common/CallbackRegistry.ts:27:22)
```

> Provide test source code if related

```js
I.waitForVisible(this.locator);
I.click(this.locator)
```

### Details

* CodeceptJS version: 3.6.4
* NodeJS Version: 18.16.1
* Operating System: mac os
* puppeteer: 22.14.0
* Configuration file:

```js
exports.config = {
fullPromiseBased: true,
tests: testsPath,
output: `${pwd}/output`,
bootstrap: () => {
global.codecept_dir = pwd;
},
name: 'xxx',
helpers: {
Puppeteer: {
show: true,
waitForNavigation: 'networkidle2',
waitForTimeout: 30000,
getPageTimeout: 30000,
windowSize: '1000x1000',
browser: 'chrome',
chrome: {
args: ['--no-sandbox',
'--window-size=1920,1000',
'--disable-setuid-sandbox',
'--disable-web-security',
// workaround for iframe in {headless: false} mode,
// see details https://github.com/puppeteer/puppeteer/issues/4964
'--disable-features=site-per-process',
],
devtools: false,
},
manualStart: false,
restart: false,
keepCookies: true,
keepBrowserState: false,
},
FileSystem: {},
},
plugins: {
screenshotOnFail: {
enabled: false,
},
retryTo: {
enabled: true
},
tryTo: {
enabled: true,
require: ''
}
},
require: ['ts-node/register'],
};
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with CodeceptJS 3.6.4, Puppeteer 22.14.0, the supplied configuration, and the I.waitForVisible/I.click sequence. Compare behavior with the earlier versions; done means the sequence completes without the Runtime.callFunctionOn protocol error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.