yinkaisheng / Python-UIAutomation-for-Windows

🐍Python 3 wrapper of Microsoft UIAutomation. Support UIAutomation for MFC, WindowsForm, WPF, Modern UI(Metro UI), Qt, IE, Firefox, Chrome ...
Apache License 2.0
2.3k stars 462 forks source link

SetGlobalSearchTimeout貌似没有起作用 #263

Closed GitHubUserC closed 7 months ago

GitHubUserC commented 8 months ago

意图通过auto.SetGlobalSearchTimeout(1)设置1秒找不到元素即超时,但使用过程中发现没有起作用,仍然使用默认10秒超时。

yinkaisheng commented 7 months ago

两种方式使用: 1,

from uiautomation import uiautomation as auto
auto.SetGlobalSearchTimeout(6)

2,

import uiautomation as auto
auto.uiautomation.TIME_OUT_SECOND = 6

import uiautomation as auto
auto.uiautomation.SetGlobalSearchTimeout(6) 

https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/master/demos/automation_calculator.py

GitHubUserC commented 7 months ago

谢谢,问题已解决。