question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot click OK on a dialog box

See original GitHub issue

Question: Need a little bit of direction. I’ve used AutoIT, inspect windows, and all that good stuff with no issues. The below in AutoIT would be running the exe, wait for window dialog, click instance of button or button with OK, and voila.

Run("C:\Program Files (x86)\Common Files\Rockwell\FTAdmin.exe")
WinWaitActive("Select FactoryTalk Directory")
ControlClick("Select FactoryTalk Directory", "OK", 1, "left", 1)

I’ve tried several ways, and nothing seems to work. I did topWindow, dialogs = app.windows(), and when I print out dialogs it gives me the below. The first wrapper is the main application class

hwndwrapper.HwndWrapper - '', Afx:00400000:0
hwndwrapper.DialogWrapper - 'M', MSCTFIME UI
hwndwrapper.DialogWrapper - 'Default IME', IME

from pywinauto.application import Application
app = Application().start("C:\Program Files (x86)\Common Files\Rockwell\FTAdmin.exe")

init_dlg = app.window(title_re="*Select FactoryTalk*", class_name="#32770")

app.init_dlg.OK.click()

I went through several examples and nothing seems to click. I am probably missing something silly.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
van9konstcommented, Nov 8, 2018

app.print_control_identifiers() will print all items that was found on window (or some area in window). in my opinion it used to be something like init_dlg.OK.click() and not app.init_dlg.OK.click()

0reactions
TheFern2commented, Nov 8, 2018

Ok I’ll try that tonight and post results. I think you might be right, I just pulled some examples from the repo that might be outdated. Thanks for the suggestions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

can't click OK button in dialog boxes on certain r...
At this resolution, when I click on certain dialog boxes (such as quick measures, drop down list in data view, the OK button...
Read more >
We've got an update for you, can't click on anything.
Just today i got this dialogue box and i was unable to click on any of the options in the dialogue box. What's...
Read more >
Fix: Word Can't do This Because a Dialog Box is Open
Launch Word, and click on File. · Click Options. · Select Trust Center. · Click Trust Center Settings. · When the Trust Center...
Read more >
Can't click buttons inside dialogue box. - Apple Community
Can't click buttons inside dialogue box. · 1. Shut down the Mac. · 2. Restart and immediately hold down the Shift key. ·...
Read more >
Fix Command Cannot Be Performed Because a Dialog Box ...
... message saying that the Command cannot be performed because a dialog box is open. Click OK and then close open dialog boxes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found