Situation
With the below code I'm getting some sort of weird Warning during run time, however, the script runs perfectly fine.
The warning prints after this line:
app.ChoosePage.Ok.Click()
This is the warning:
WARNING! Cannot retrieve text length for handle = <pywinauto.controls.win32_controls.DialogWrapper object at 0x0568C6D0>
Question
Is there a way to prevent this Warning from printing?
Attempts
I've tried using the below to no avail:
pywinauto.actionlogger.disable()
## OR
pywinauto.actionlogger.set_level(30)
There is no way to disable such warnings yet. Probably in your case dialog is already closed when pywinauto trying to get its caption. This warning also may raise when app doesn't respond. It assumed to be very rare case.
I moved it from plain print()
function to actionlogger
stuff. So it will be disabled by default in pywinauto 0.5.2.