Traceback (most recent call last):
File "D:/python_work/CAS_AutoTest/ut/ut.py", line 41, in
auto.WindowControl(searchDepth=1, AutomationId="myMainWindow", RegexName="Login").SetActive()
File "D:\Python37-32\lib\site-packages\uiautomation\uiautomation.py", line 6907, in SetActive
elif not IsWindowVisible(handle):
File "D:\Python37-32\lib\site-packages\uiautomation\uiautomation.py", line 2124, in IsWindowVisible
return bool(ctypes.windll.user32.IsWindowVisible(ctypes.c_void_p(handle)))
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type
在项目中尝试结合pywinauto 一起进行自动化测试,但是只要导入pywinauto, 使用uiautomaiton中的SetActive()方法就提示类型错误。
Traceback (most recent call last): File "D:/python_work/CAS_AutoTest/ut/ut.py", line 41, in
auto.WindowControl(searchDepth=1, AutomationId="myMainWindow", RegexName="Login").SetActive()
File "D:\Python37-32\lib\site-packages\uiautomation\uiautomation.py", line 6907, in SetActive
elif not IsWindowVisible(handle):
File "D:\Python37-32\lib\site-packages\uiautomation\uiautomation.py", line 2124, in IsWindowVisible
return bool(ctypes.windll.user32.IsWindowVisible(ctypes.c_void_p(handle)))
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type