Is there a way to emulate keystrokes and mouse-clicks in a Linux OS such as Raspbian?

129 Views Asked by At

I am working on a project that edits photos of mine and then uploads those photos to a google site. I'm using Selenium to upload the photos to the portfolio site, but I need a way to select the image I want to upload from the file manager.

The idea is that this project will run on my Raspberry Pi 3b without any need for human intervention. Is it even possible to emulate human interactions with the OS?

I have done some research and have come across the program AutoKey, but I am not entirely sure if this will work for what I need on Raspbian. Any help would be greatly appreciated.

Update: I attempted to install autokey on to my raspberry pi, and even though the install seemed successful, I am unable to open or use the application. It seems I may be missing some dependencies or that autokey just isn't compatible on Raspbian. All I really need is a way for me to navigate to the path of the photo I want to upload and to select it.

Second Update: While searching through the selenium documentation I found this https://selenium-python.readthedocs.io/faq.html#how-to-upload-files-into-file-inputs which seems like it could be a solution. I have not yet had time to try this out yet on both my Macbook and Raspberry Pi.

Final Update I was able to upload the file using selenium, but part of the process is jerry-rigged to work. I am curious to know if there is another, more professional way to do this so I will leave the question up in the meantime.

0

There are 0 best solutions below