pyautogui is unable to mouse-click the installer

Asked 2 years ago, Updated 2 years ago, 115 views

I would like to ask you a question regarding the subject matter.

Status

With the installer file (.exe/.msi) open, I thought it would be possible to automate the setup, so I programmed it to click using Python's module pyautogui, but the click operation did not respond and I am having trouble dealing with it.

Current behavior and error content

·It has been confirmed that the mouse cursor has been moved to the target of the click specified in locateOnScreen().
→But for some reason, they don't click.
·We have confirmed that files other than the installer (e.g., Microsoft Edge) are made without any problems such as clicking.
·When I check the return value when I click(), it says None.
·When executing the py file, no errors appear, so it is difficult to determine whether the image recognition itself is not possible.

Tried

·There is a possibility that there is an error in coding in the first place, so I tried to implement the process of clicking on another icon.
→ I was able to click without any problems.
·Recaptured
because the image to be recognized may be bad. ·The confidence was introduced into the argument of locateOnScreen(), so the accuracy was adjusted.
·From locateOnScreen() to click(), sometimes the click operation is idle due to the lack of recognition, so time.sleep(1) is set between them to give room.
"·You can proceed with the target installer by clicking the mouse, or by typing the key (like ""Next(N)""), so
" Changed click() to hotkey('alt', "n").

→ I tried these, but none of them were allowed.

The installer I prepared as a sample this time will be CubePDF, but
Is it impossible to operate an installer like this with pyautogui in the first place?
Since there were no related articles, I don't know what the cause is, so I would like to ask for your help.
Thank you for your cooperation.

#Module Import
import time
import pyautogui as pag

defmain():
    try:
        # CubePDF
        event=pag.locateOnScreen(The capture file path you want to click on (as specified in the absolute path).I put an r in front of the path.)])
        time.sleep(1)
        pag.click (event)

    except Exception as:
        print(e)

if__name__=="__main__":
    main()

python pyautogui

2022-09-30 16:07

1 Answers

Pyautogui doesn't seem to respond depending on the product (checked operation)
·setup command
Or
·sendkeys class using powershell
Using these two, we implemented silent installation/GUI operation automation.


2022-09-30 16:07

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.