pywinauto: not able to click a button

Hi All,

I am trying to automate windows based application which contains spaces in the application name. I am able to open app with the help of below code:

from pywinauto.application import Application
app=Application().start('c:\\program files\\ESPWorkstation.exe')

we will receive a popup window (below) which allows us to proceed further popup

now i need to click on load button to proceed further.

Can some one help me on this issue?

Also, I need to navigate to a window which contains spaces after clicking load button to proceed with.

Thanks, rajarameshmamidi

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 38 (16 by maintainers)

Most upvoted comments

Hi Folks Even i am trying to do similar thing … i just opened my app which needs to be automated. Hope i have clearly mentioned now what am trying to in the below code as a comment

https://stackoverflow.com/questions/24606219/how-to-perform-click-action-on-button-or-text-field-by-pywinauto As answered in the above stackoverflow question, was not able to execute succesfully by mentioned two level hirearchies to perform the desired UI automation

image

from pywinauto import Desktop, Application
import time
import pyautogui
Application().start('explorer.exe "C:\\Users\\tm\\Desktop\\new vantage\\PCMark_Vantage_v120_installer.exe"')
#started and connected app
app = Application(backend="uia").connect(path="explorer.exe", title="PCMark Vantage - InstallShield Wizard")
dlg = app.window(title_re='PCMark Vantage - InstallShield Wizard', class_name = '#32770')
'''
now after the above step , i opened the app ... now in the mentioned screenshot i want to click either  Next> or cancel button which was not able to get the control in that particular dialogue window . Need help on how to perform click action on either of those buttons
'''
app.??????.Cancel.click()
#dlg.child_window(best_match='Next').click()
print(dlg)

Hi @rajarameshmamidi this is easy to use spaces with key access instead of attribute access:

app['Load the User Profile'].LoadButton.click_input()

Anyway the name like app.Load_the_User_Profile should work since the best_match algorithm is resistant to typos. This is approximate matching of the name.

For more details I’d recommend to learn the Getting Started Guide first before submitting so many questions. If some paragraph is unclear in the guide, it’s a good reason to submit an issue.

Thanks for understanding.