jeudi 22 octobre 2020

TestCafe Screenshot gives error Error: not opened at WebSocket.send

I get following error

Was unable to take a screenshot due to an error.

Error: not opened at WebSocket.send (/userdir/node_modules/ws/lib/WebSocket.js:359:18) at Chrome.enqueueCommand (/userdir/node_modules/chrome-remote-interface/lib/chrome.js:130:16) at /userdir/node_modules/chrome-remote-interface/lib/chrome.js:88:28 at new Promise () at Chrome.send (/userdir/node_modules/chrome-remote-interface/lib/chrome.js:87:16) at Object.handler [as captureScreenshot] (/userdir/node_modules/chrome-remote-interface/lib/api.js:32:23) at Object.getScreenshotData (/userdir/node_modules/testcafe/src/browser/provider/built-in/dedicated/chrome/cdp.ts:129:46) at BrowserProviderPluginHost.takeScreenshot (/userdir/node_modules/testcafe/src/browser/provider/built-in/dedicated/base.js:68:52) at BrowserProvider.takeScreenshot (/userdir/node_modules/testcafe/src/browser/provider/index.ts:354:31)

It works for the first two time and later it keeps giving the above error.

My code is await t.takeScreenshot()

Video recording also gives below error consistently. I have tried in many ways but was never able to get the video recording started.

An unexpected error has occured: { Error: Unable to set video or encoding options when video recording is disabled. Specify the base path where video files are stored to enable recording.

I did try providing the base path

        .video('artifacts/videos/', {
            singleFile: true,
            failedOnly: false,
            pathPattern: '${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.mp4',
            ffmpegPath: '/usr/local/bin/ffmpeg'
        }, {
            r: 20,
            aspect: '4:3'
        })

Aucun commentaire:

Enregistrer un commentaire