How can I get message from ErroDialog with pywinauto

Viewed 88

I'm trying to automate a windows process with pywinauto, but when I get a ErroDialog (like the image) I'm not getting the error message. Any idea?

erroDialog image example

Python version -> 3.10.1

my attempts below....

#1    
for x in app.windows()[0].descendants():
        print (x.window_text())
        print (x.class_name())

#2
print([w.window_text() for w in app.windows()])

#3
#like this is getting the title of dialog 
print(app[title_window].child_window(title="Erro").window_text())

#4
#like this getting the parent instead dialog. 
print(app.top_window().window_text())

#5
#just the dialog title
app[title_window].child_window(title="Erro", control_type="Window").texts()

Control Identifiers:

Dialog - 'Erro'    (L388, T304, R978, B423)
['ErroDialog', 'Dialog', 'Erro']
child_window(title="Erro", control_type="Window")
   |
   | TitleBar - ''    (L391, T307, R975, B330)
   | ['TitleBar']
   |    |
   |    | Button - 'Fechar'    (L942, T305, R976, B330)
   |    | ['Button', 'Fechar', 'FecharButton']
   |    | child_window(title="Fechar", control_type="Button")
0 Answers
Related