Python Forum
How to automate the clicking of GUI's menu?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to automate the clicking of GUI's menu?
#1
Hello,

I have a question about GUI libraries. I am working on an automation program. I use coordinate info of a command (for example, file -> open or about -> help) via pyautogui. However, according to screen resolution or program window location, this command’s coordinate can be changed. To fix this problem, I want to move without coordinate. How can I select a command of a program via GUI libraries? Is it possible to make this? Because I know, pywinauto has a special movement for Notepad (app.Notepad.menu_select(“File->SaveAs”). I wonder, can I use this for other programs?
Reply
#2
Okay please clarify your question a bit more -- as far as I know if you presenting something on a screen you have to use coordinates as that is the only way to communicate to the hardware where to place what it is you want drawn on the display device and yes the coordinate system adjusts to the display mechanism(s) as this is what it has to do to render things properly.

Now if you are talking about something else then perhaps you can as the only time you need coordinates are when you are working to display something upon a display device. Your mentioning of coordinates in conjunction with function calls has me a bit confuzzled as these are not synonymous concepts
Reply
#3
Yes pywinauto can access the menu directly with other programs than notepad.
In the code app.Notepad.menu_select(“File->SaveAs”) Notepad is not hard coded, it looks for a window with the title Notepad.

pywinauto entry points for automation
Reply
#4
Yes, we can work on the menu items directly. Just we have to get the properties of the window/dialog elements and use them directly in your cide
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Clicking Every Page and Attachment on Website shoulddt 1 1,700 Jul-09-2021, 01:08 PM
Last Post: snippsat
  Using IDLE, bug when clicking code StarBasket 4 2,424 Jul-31-2019, 12:30 PM
Last Post: Malt
  Pop up the Python shell after clicking a window aking76 0 2,124 Sep-18-2018, 02:27 PM
Last Post: aking76
  1. How can I automate this batch creation of documents? 2. How can I automate posting SamLearnsPython 2 3,387 Jul-02-2018, 11:36 AM
Last Post: buran
  Function for clicking a button within a browser NikonNorm 6 4,381 Jun-06-2018, 04:08 PM
Last Post: Grok_It

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020