python - Selecting children from TreeView using pywinauto -
the issue have related the getitem()
method pywinauto
. able run window.treeview.getitem('\\desktop').click()
command on windows 7 , 10 both 32 bit throws exeption , not run when calling python command line of windows 10 64 bit.
this full code use:
import pywinauto pwa_app = pywinauto.application.application() w_handle = pywinauto.findwindows.find_windows(title=u'browse folder', class_name='#32770')[0] window = pwa_app.window_(handle=w_handle) window.treeview.getitem('\\desktop').click()
these errors receive:
traceback (most recent call last): file "<stdin>", line 1, in <module> file "c:\python27\lib\site-packages\pywinauto\controls\common_controls.py", line 1374, in getitem texts = [r.text() r in roots] file "c:\python27\lib\site-packages\pywinauto\controls\common_controls.py", line 872, in text return self._readitem() file "c:\python27\lib\site-packages\pywinauto\controls\common_controls.py", line 1263, in _readitem raise ctypes.winerror() windowserror: [error 0] operation completed successfully.
i have mention can access root of tree view window.treeview.getitem([0]).click()
it happens because win32 api structure sizes windows messages different 32-bit , 64-bit apps. it's fixed in uia branch (you can wait 0.6.0 planned summer).
another way set 32-bit python (and pywinauto) in addition 64-bit python (you need care full path python.exe
).
Comments
Post a Comment