You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: [nut.js] - Error: Searching for C:\Users\---\nut-js-testing\images\windows\actionPalette.png failed.
Reason: 'Error: Error: x coordinate outside of display'
at ScreenClass.find (C:\Users\---\nut-js-testing\node_modules\@nut-tree\nut-js\dist\lib\screen.class.js:169:27)
at async C:\Users\---\nut-js-testing\scripts\interactions.js:22:27
It says that the 'x coordinate' is 'outside' of the display.
I can make a slightly smaller region, adding 8px to the left and top to resolve this issue, however, I don't think this should be the permanent solution.
As far as I can tell, the result of getActiveWindow() should be bound by the current screen, specifically if the window is maximized.
Full code sample to reproduce
constnut=require('@nut-tree/nut-js');require('@nut-tree/nl-matcher');// * current window is maximized(async()=>{try{letreg=await(awaitnut.getActiveWindow()).region;awaitnut.screen.find(nut.imageResource(actionPalette),{searchRegion: reg});}catch(err){console.error(err);}})();
Additional content
Please provide any (mandatory) additional data to reproduce the error (Dockerfiles etc.)
The text was updated successfully, but these errors were encountered:
this stems from the fact that window decorations are counted towards the window size, leading to out of bounds windows in case of full screen windows or windows close to the screen border.
That should be accounted for 👍
* (#559) Adjust getRegion implementation
It’ll now cut off window regions at the borders of the main screen, avoiding errors due to out of bounds regions
* (#559) Moved window e2e test into dedicated e2e subpackage
Version
nut.js 3.1.2
Short overview
The
region
attribute of a full-screenwindow
(returned bygetActiveWindow()
), stretches beyond the screen borders, causing problems.Issue occurs on
node version:
16.20.2
OS type and version:
Windows 10
Detailed error description
I have an application in 'maximized' mode (full-screen).
After the above code is run, I get this error:
It says that the 'x coordinate' is 'outside' of the display.
I can make a slightly smaller region, adding 8px to the
left
andtop
to resolve this issue, however, I don't think this should be the permanent solution.As far as I can tell, the result of
getActiveWindow()
should be bound by the current screen, specifically if the window is maximized.Full code sample to reproduce
Additional content
The text was updated successfully, but these errors were encountered: