Is there any tool in Node.js helping to make command like click() or moveTo() with your mouse? In order to automate tests I need to use another app where the button need being clicked. Or maybe I can do that using command prompt?
Related
I like GNOME builder for being GTK and having some level of code completion, but I want to use the IDE features more. That being said, I work on some JavaScript projects, so using the run button would be of great use. I know that GNOME builder relies on Meson, and I can't figure out how to set the 'run' function (?) as a command in Meson.
I have an window application that install in pc, I wish to used Python code to auto click on a icon after the application open. Below is my application look:
from this case I wish to used code to look for the Excel Icon and auto click it, the purpose of this icon is download the data.
I cannot used webdriver function because this is not the web application and this application don't have any coding behind, that mean when i run on Sample.exe it will direct pop up this window as the picture shown here.
Anyone have any idea on this?
import pyautogui
while True:
iconX, iconY = pyautogui.locateCenterOnScreen('icon.png')
pyautogui.doubleClick(iconX, iconY)
There are many different types of modules that you can use in order to achieve this but the one i would recommend is python auto GUI. This allows for screen searches and control over peripherals such as a mouse and keyboard. The code is relatively simple and is very basic. You can install it using the pip function using pip install pyautogui.
The code to achieve something like you say is one of the first things you will be able to do and if you need further help then feel free to ask but for convenience I will drop a website with the following functions.
https://pypi.org/project/PyAutoGUI/
I shall provide a demo code above.
I know how to set a keyboard command shortcut, that's easy, I just go to Applications > Settings > Keyboard and then click the Application Shortcuts tab within my Manjaro Linux system and set whatever command to whatever shortcut.
But how can I make it run that command on a selected file or selection of files?
Is there something I can change or add to the command to make it run on the file or files currently selected within my XFCE desktop environment?
Thanks!
Your approach would require to correlate your mouse position to your desktop and file-manager. Then you would need to have knowledge of the internal state. You then would need to display some GUI. This way of thinking in regards of programing is seriously wrong.
What you are looking for are context menu actions. So keep it that way.
You have files on your desktop or in the file-manager and can call user defined actions on one or more files. I think XFCE had something like Thunar. You may use caja wit caja --no-desktop and create some actions with caja-actions-config-tool. Gnome still has it, if you prefer Nautilus.
I'm curious what's the easy way of building command-line menu like on the picture? There are some more cool options like using dialog app and other apps like that, but i just want to have very simple in-line solution and not pollute the whole screen.
NB: on example gif you see replacement of string in the command line above the menu, but i do not need that.
I just need cool simple menu(s) in my bash script(s).
Thanks!
I've been working on a native Node.js module called RobotJS that allows the user to automate the mouse and keyboard. I've been trying to find a way to automate testing for keyboard and mouse events. For example, I need to be able to confirm that RobotJS is sending the correct keycodes, like "a" and "!". And I need to be able to detect mouse clicks.
I got this working locally using the terminal, here is the code to detect mouse clicks:
https://github.com/octalmage/robotjs/blob/keyboard-tests/test/detectMouse.js
But it doesn't work on TravisCI. I imagine because they don't open an actual terminal window, even though I start xvfb and can detect mouse movement.
I considered writing a new application using Electron to open a window to detect the events, but I'd rather not if I could get my current tests to work.
Thoughts? Here's my current .travis.yml:
https://github.com/octalmage/robotjs/blob/master/.travis.yml
And here's the projects GitHub:
https://github.com/octalmage/robotjs