CodeceptJS
CodeceptJS copied to clipboard
Error: frame.frameElement: Frame has been detached
Problem Statement
If the current context is a frame and if that frame is detached after performing any user interaction, the system throws an error in the case of node 16 and a warning incase of node14.
Error/Warning
Node v14
(node:4440) UnhandledPromiseRejectionWarning: frame.frameElement: Frame has been detached.
at C:\Users\#######\Project\projectName\node_modules\codeceptjs\lib\helper\Playwright.js:2756:46
(Use `node --trace-warnings ...` to show where the warning was created)
(node:4440) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 14)
(node:4440) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Node v16
Uncaught frame.frameElement: Frame has been detached.
at C:\Users\#######\Project\projectName\node_modules\codeceptjs\lib\helper\Playwright.js:2756:46
Steps to reproduce
Prerequisite: there should be a frame that will be removed from the dom after a click
- Switch to frame (I.switchTo(frameLocator);
- Click on a button (I.click(buttonLocator)
- switch back to default frame
Expected
all three steps should be executed without error
Actual
Getting error during the execution of the 2nd step.
Details
- CodeceptJS version: 3.3.0
- NodeJS Version: 14 (warning) and 16 (Error)
- Operating System: Windows
- puppeteer version: 1.19.2