Error on create screenshot when running testcafe on selenium grid (since version 1.18.3)
See original GitHub issueWhat is your Scenario?
We are running testcafe tests on selenium grid using this plugin: https://github.com/alexschwantes/testcafe-browser-provider-selenium Since testcafe update to 1.18.3 there is an error on screenshot generate:
What is the Current behavior?
Screenshot error occurs when running tests on remote browser on selenium grid
What is the Expected behavior?
Screenshots should be generated without error when running test on remote browser
What is your public website URL? (or attach your complete example)
It is reproducible with any test run using the selenium grid
What is your TestCafe test code?
import {Selector, t} from “testcafe”
fixture example
.page https://gojs.net/latest/samples/minimalBlob.html
;
test(‘Throw error’, async t => { await t.expect(Selector(“#blobButton”).exists).notOk(“Error occured”);
});
Your complete configuration file
package.json:
{ “name”: “testcafeexample”, “version”: “1.0.0”, “description”: “”, “main”: “example.js”, “scripts”: { “test”: “testcafe selenium:chrome example.js -s takeOnFails=true” }, “author”: “”, “license”: “ISC”, “dependencies”: { “testcafe”: “1.18.3”, “testcafe-browser-provider-selenium”: “^1.2.0” } }
Your complete test report
example ✖ Throw error
-
AssertionError: Error occured: expected true to be falsy
Browser: Chrome 97.0.4692.99 / Linux 0.0
1 |import {Selector, t} from “testcafe” 2 |fixture
example
3 | .pagehttps://gojs.net/latest/samples/minimalBlob.html
; 4 | 5 |test(‘Throw error’, async t => {6 | await t.expect(Selector(“#blobButton”).exists).notOk(“Error occured”); 7 | 8 |}); 9 |
at <anonymous> (/home/asia/testcafeExample/example.js:6:52) at asyncGeneratorStep (/home/asia/testcafeExample/example.js:1:218) at _next (/home/asia/testcafeExample/example.js:1:556) at <anonymous> (/home/asia/testcafeExample/example.js:1:721) at <anonymous> (/home/asia/testcafeExample/example.js:1:462) at <anonymous> (/home/asia/testcafeExample/example.js:5:5)
1/1 failed (8s)
Warnings (1):
Was unable to take a screenshot due to an error.
RangeError [ERR_OUT_OF_RANGE]: The value of “sourceStart” is out of range. It must be >= 0. Received -3538404 at _copy (buffer.js:227:13) at Buffer.copy (buffer.js:769:12) at Object.copyImagePart (/home/asia/testcafeExample/node_modules/testcafe/src/screenshots/utils.js:50:23) at Object.cropScreenshot (/home/asia/testcafeExample/node_modules/testcafe/src/screenshots/crop.js:140:12) at processTicksAndRejections (internal/process/task_queues.js:93:5) at /home/asia/testcafeExample/node_modules/testcafe/src/screenshots/capturer.js:152:34 at Capturer._capture (/home/asia/testcafeExample/node_modules/testcafe/src/screenshots/capturer.js:133:9) at Capturer.captureError (/home/asia/testcafeExample/node_modules/testcafe/src/screenshots/capturer.js:190:16) at BrowserManipulationQueue._takeScreenshot (/home/asia/testcafeExample/node_modules/testcafe/src/test-run/browser-manipulation-queue.js:55:20) at BrowserManipulationQueue._executeCommand (/home/asia/testcafeExample/node_modules/testcafe/src/test-run/browser-manipulation-queue.js:83:24) npm ERR! Test failed. See above for more details.
Screenshots
No response
Steps to Reproduce
1.use package.json and testexample provided above 2. run npm install 2. run selenium grid docker image, available with this command: docker run -d -p 4444:4444 --shm-size=“2g” selenium/standalone-chrome:4.1.1-20220121 3. run npm test NOT OK - error occurs on screenshot generate attempt
TestCafe version
1.18.3
Node.js version
12.16.3
Command-line arguments
testcafe selenium:chrome example.js -s takeOnFails=true
Browser name(s) and version(s)
Chrome 97.0.4692.99
Platform(s) and version(s)
linux ubuntu 20
Other
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:10 (1 by maintainers)
Top GitHub Comments
@wombatka Thank you for the detailed report. I reproduced the issue. We will research it and update this thread once we have news.
Fixed in https://github.com/DevExpress/testcafe/pull/6897.