Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnhandledPromiseRejectionWarning: RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range #22

Open
bkosse opened this issue Jul 13, 2018 · 7 comments

Comments

@bkosse
Copy link

bkosse commented Jul 13, 2018

When using Firefox Geckodriver, vrt returns the following error when capturing a screenshot of the specified element:

(node:24488) UnhandledPromiseRejectionWarning: RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 7253872. Received -1179984 at boundsError (internal/buffer.js:55:9) at Buffer.readUInt32BE (internal/buffer.js:198:5) at Jimp.<anonymous> (D:\TFS\Wavin\Wavin_SXP_TestAutomation\Nightwatch\node_modules\jimp\index.js:896:37) at Jimp.scan (D:\TFS\Wavin\Wavin_SXP_TestAutomation\Nightwatch\node_modules\jimp\index.js:679:15) at Jimp.crop (D:\TFS\Wavin\Wavin_SXP_TestAutomation\Nightwatch\node_modules\jimp\index.js:895:10) at Jimp.read.then (D:\TFS\Wavin\Wavin_SXP_TestAutomation\Nightwatch\node_modules\nightwatch-vrt\commands\captureElementScreenshot.js:65:24) at process._tickCallback (internal/process/next_tick.js:68:7) (node:24488) 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(). (rejection id: 1) (node:24488) [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.

This error does not occur when using Chromedriver.

nightwatch: v0.9.21
vrt: v0.2.6
Geckodriver: v0.21.0
Selenium Standalone Server: v3.13.0

Element specifications:
y = -156.1999969482422
height = 1115.199951171875
screenshot.bitmap.height = 959

x = 0
width = 1891
screenshot.bitmap.width = 1891

@digitalresistor
Copy link
Contributor

Do you have a sample that I can use to re-create this issue?

@ihorsavka
Copy link

Same here

@bkosse
Copy link
Author

bkosse commented Oct 24, 2018

Basically the issue occurs when the selected element exceeds the viewport of the browser. But only in Firefox.

So on this page (#22) when trying to capture the element with class .js-discussion the error occurs.

browser.assert.screenshotIdenticalToBaseline(element, '.js-discussion');

@Qvatra
Copy link

Qvatra commented Aug 9, 2019

have exactly the same for chrome

@apboon
Copy link

apboon commented Feb 2, 2021

Same here. Chrome 88.

issue occurs when the selected element exceeds the viewport of the browser

I must agree. I was trying screenshotIdenticalToBaseline on body and in some cases the body's height exceeded the browser's viewport. My temporary solution / workaround: I'm adding style body { height: 100%; } before comparison.

@Pverma96
Copy link

Pverma96 commented Feb 8, 2021

Same here. Chrome 88.

issue occurs when the selected element exceeds the viewport of the browser

I must agree. I was trying screenshotIdenticalToBaseline on body and in some cases the body's height exceeded the browser's viewport. My temporary solution / workaround: I'm adding style body { height: 100%; } before comparison.

@apboon Could you please elaborate a little more about your workaround and where have you added the style in the project.

@apboon
Copy link

apboon commented Feb 8, 2021

Not any particular location in my project. I just made sure the style was applied with the objective of the thing that a wanted to capture isn't larger than the browser's viewport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants