samick17 / windows-automator-lib

This is the wrapper of windows-OS mouse/keyboard API implemented in C++.Wrapped in NodeJs
MIT License
3 stars 1 forks source link

npm ERR! Failed at the windows-automator-lib@1.4.7 install script #5

Open madhavipeddi opened 5 years ago

madhavipeddi commented 5 years ago

Hi,

I am using windows-automator-lib to resize and close the window.

const WinAutomatorLib = require('windows-automator-lib'); var Core = WinAutomatorLib.Core; var data = _.filter(Core.getAllWindows(), function (ele) { if (ele.name === 'File Manager (@FM)') { return ele.hwnd; } }); Core.switchToWindowByName(data[0]); var height = Core.getWindowRect(data[0].hwnd).h-20; Core.mouseMove(Core.getWindowRect(data[0].hwnd).x+Core.getWindowRect(data[0].hwnd).w-10, Core.getWindowRect(data[0].hwnd).y+Core.getWindowRect(data[0].hwnd).h-height); Core.mouseLeftClick(true);

Above code is working fine, but when I am trying to run on Jenkins, getting below mentioned errors. npm ERR! Failed at the windows-automator-lib@1.4.7 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Can you please look into it and provide a workaround to run windows-automator-lib on Jenkins(Linux) build?

Thanks, Madhavi JenkinsEroor

samick17 commented 5 years ago

Hi Madhavi:

This library is made by win32 API (C++ binding).
It will not works on linux-based OS.
If you want to do similar things on linux, "xdotool" may be a good solution.

http://xmodulo.com/simulate-key-press-mouse-movement-linux.html

Samick